Skip to content

Add option to use clang's MSVC ABI#729

Merged
saghul merged 5 commits intoquickjs-ng:masterfrom
Oliver-makes-code:master
Dec 4, 2024
Merged

Add option to use clang's MSVC ABI#729
saghul merged 5 commits intoquickjs-ng:masterfrom
Oliver-makes-code:master

Conversation

@Oliver-makes-code
Copy link
Copy Markdown
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
Copy Markdown
Contributor

saghul commented Dec 2, 2024

Can't we detect this in CMake?

@Oliver-makes-code
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor Author

It seems to work

Comment thread CMakeLists.txt Outdated
Comment thread CMakeLists.txt Outdated
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