You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
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 #728
It's checking for MSVC, which is only set when CMake uses cl or clang-cl (we're using normal clang)
But since Clang is using MSVC's ABI (Target x86_64-pc-windows-msvc) it needs to link to MSVC's libraries
The llvm package on Chocolatey, by default, uses MSVC ABI. Otherwise you can use -target x86_64-pc-windows-msvc in the command line arguments. See https://clang.llvm.org/docs/CrossCompilation.html
Activity
saghul commentedon Dec 1, 2024
What CMake incantation do you use to compile that way?
I guess it's not surprising since we do link to libm on Unix for the math functions.
Oliver-makes-code commentedon Dec 1, 2024
The problem is here: https://github.com/quickjs-ng/quickjs/blob/master/CMakeLists.txt#L215-L217
It's checking for MSVC, which is only set when CMake uses
clorclang-cl(we're using normalclang)But since Clang is using MSVC's ABI (Target
x86_64-pc-windows-msvc) it needs to link to MSVC's librariessaghul commentedon Dec 2, 2024
You don't answer my question though. How do you target that?
Oliver-makes-code commentedon Dec 2, 2024
The
llvmpackage on Chocolatey, by default, uses MSVC ABI. Otherwise you can use-target x86_64-pc-windows-msvcin the command line arguments. See https://clang.llvm.org/docs/CrossCompilation.htmlsaghul commentedon Dec 2, 2024
Thanks for explaining, let's continue in the PR.
Fix linking with libm
Fix linking with libm
Link against libm unconditionally on Unices
Link against libm unconditionally on Unices (#1699)