Open kotx opened 3 years ago
Also, this might not be related but I can't specify c++20
, I must specify c++2a
for it to configure successfully. However, my clang++ version is 12.0.0.
meson.build:1:0: ERROR: Value "c++20" (of type "string") for combo option "C++ language standard to use" is not one of the choices. Possible choices are (as string): "none", "c++98", "c++03", "c++11", "c++14", "c++17", "c++1z", "c++2a", "gnu++11", "gnu++14", "gnu++17", "gnu++1z", "gnu++2a".
This problem does not occur on my other machine that only has VS2019 and meson installed.
It appears you're using vanilla clang, is that your intention? I'm not sure what the status of vanilla clang (as opposed to clang-cl) with link or lld-link is.
It appears you're using vanilla clang, is that your intention? I'm not sure what the status of vanilla clang (as opposed to clang-cl) with link or lld-link is.
I'm not sure, I'm not running in a VS Developer command prompt though, so it shouldn't be in PATH (I think..)
Can you check that you're getting the same compiler for both of them? I think meson is selecting msvc on one of your machines, and clang on the other, and that's where the problems are coming from.
You can try (assuming you're using cmd.exe):
set CC=cl
set CXX=cl
meson setup $builddir --wipe
and see if that helps.
Can you check that you're getting the same compiler for both of them? I think meson is selecting msvc on one of your machines, and clang on the other, and that's where the problems are coming from.
You can try (assuming you're using cmd.exe):
set CC=cl set CXX=cl meson setup $builddir --wipe
and see if that helps.
It can't find cl.exe: Running "cl /?" gave "[WinError 2] The system cannot find the file specified"
Using it from the VS Dev prompt (or running vcvarsall.bat first) works, however I must specify c++latest
instead of c++20
since that's how msvc does versions AFAIK. That might be less portable
It's rather unfortunate that gcc and clang use versions like c++1x
and c++2a
and msvc just uses c++latest
. I'm not really sure what we can do about that though.
How do I make meson/ninja not use msvc then? Is that possible?
Seems like the linker detection is broken yet again? https://github.com/mesonbuild/meson/blob/a9959a385990bb9760cfdb5fda9a6bc6fb7725fe/mesonbuild/linkers.py#L1183-L1204
If this build is actually using clang
to invoke link
then -Wl,--subsystem,windows
should never be passed. The same logic applies to lld-link
too, yet somehow it seems meson thinks the linker is a gnu-ish linker.
https://github.com/mesonbuild/meson/blob/a9959a385990bb9760cfdb5fda9a6bc6fb7725fe/mesonbuild/linkers.py#L695-L705
Invoking lld-link
through clang
should have been working fine ever since the commits to fix the detection landed upstream. I originally introduced them to build EFI apps with clang
+ lld-link
and it works fine on my end.
Describe the bug I installed llvm via scoop and tried to compile a hello world program (created by
meson init
). Worked with gcc, so I thought this was an llvm issue. Not sure. I have Visual Studio 2019 installed with the C++ toolchains. (Using ninja backend though)When I run
meson compile -C build
(aftermeson build
):To Reproduce
However, removing
win_subsystem
altogether produces the above error but withconsole.obj
instead ofwindows.obj
. The option/-subsystem
still is present and not recognized.Expected behavior An executable with
windows_subsystem
ofwindows
is compiled.system parameters
meson --version
0.56.0 (but 0.58.0 according to pip)ninja --version
if it's a Ninja build 1.10.1