Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to use clang's MSVC ABI #729

Merged
merged 5 commits into from
Dec 4, 2024

Conversation

Oliver-makes-code
Copy link
Contributor

Fixes #728.

Adds QJS_CLANG_MSVC_ABI option, defaulted to OFF. It doesn't link libm if it's ON.
I opted to have it be an option, because implementing behavior to check the clang target would add too much complexity.

@saghul
Copy link
Contributor

saghul commented Dec 2, 2024

Can't we detect this in CMake?

@Oliver-makes-code
Copy link
Contributor Author

You can detect it, but since it's a generally niche use-case, it didn't seem worth the extra complexity to me.

@saghul
Copy link
Contributor

saghul commented Dec 2, 2024

I politely disagree :-)

Let's see how much it really takes to get this right.

Would this work?

find_library(M_LIBRARIES m)
if(M_LIBRARIES)
    list(APPEND qjs_libs m)
endif()

@bnoordhuis
Copy link
Contributor

it's a generally niche use-case, it didn't seem worth the extra complexity to me.

The counterargument is that build options are really hard to remove once people start depending on them, so adding them should be done sparingly.

@Oliver-makes-code
Copy link
Contributor Author

I politely disagree :-)

Let's see how much it really takes to get this right.

Would this work?

find_library(M_LIBRARIES m)
if(M_LIBRARIES)
    list(APPEND qjs_libs m)
endif()

This could work

@saghul
Copy link
Contributor

saghul commented Dec 2, 2024

Can you give it a try? If it works we could just land that.

@Oliver-makes-code
Copy link
Contributor Author

It seems to work

CMakeLists.txt Outdated Show resolved Hide resolved
CMakeLists.txt Outdated Show resolved Hide resolved
@saghul saghul merged commit ebc1a65 into quickjs-ng:master Dec 4, 2024
59 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants