Skip to content

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

@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

Development

Successfully merging this pull request may close these issues.

Compiling with CMake & Clang on Windows with MSVC ABI (not using clang-cl or the MSVC toolchain) causes QuickJS to try to link to m.lib

3 participants