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
Inconsistent behavior between target:has_tool("cxx", "clang_cl") and package:has_tool("cxx", "clang_cl"). I confirm there is a valid clang-cl compiler in the environment, but the former returned true while the later gave false.
Moreover, this leads to the absense of subsystem:console linker flag in catch2 in xmake-repo.
Expected Behavior
The bahavior should be consistent, which both return value should be true.
Project Configuration
I used a modified version of catch2.lua in xmake-repo, and a minimal xmake.lua to reproduce it. I use --cc=clang-cl --cxx=clang-cl to enforce compiler to be clang-cl:
xmake f -p windows -a x64 -m release --cc=clang-cl --cxx=clang-cl -c -v
gives:
checking for cl.exe ... C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\bin\HostX64\x64\cl.exe
checking for Microsoft Visual Studio (x64) version ... 2022
checking for zig ... no
checking for zig ... no
checking for nim ... no
checking for nim ... no
checking for unzip ... ok
checking for git ... ok
checking for gzip ... ok
checking for tar ... ok
package:is_plat("windows")
git rev-parse HEAD
checking for cmake ... no
checking for cmake ... no
checking for cmake ... no
checking for cmake ... C:\Program Files\CMake\bin\cmake
checking for xmake::catch2mod ... catch2mod v3.5.4
checking for link.exe ... C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\bin\HostX64\x64\link.exe
checking for the linker (ld) ... link.exe
target:has_tool(clang_cl)
configure
{
mode = release
clean = true
cc = clang-cl
plat = windows
buildir = build
ccache = true
theme = default
kind = static
host = windows
vs = 2022
proxy_pac = pac.lua
ndk_stdcxx = true
arch = x64
network = public
cxx = clang-cl
}
The text was updated successfully, but these errors were encountered:
please use xmake f --toolchain=clang-cl or set_toolchains("clang-cl"), or add_requires("xxx", {configs = {toolchains = "clang-cl"}}) instead of xmake f --cc=clang-cl --cxx=clang-cl
Ok, I'm specifying compiler directly to workaround another problem, in which ninja + clang-cl won't enable c++ exceptions by default on Windows. Perhaps I'll open another issue for this.
Xmake Version
2.9.1
Operating System Version and Architecture
Windows 10 22H2
Describe Bug
Inconsistent behavior between
target:has_tool("cxx", "clang_cl")
andpackage:has_tool("cxx", "clang_cl")
. I confirm there is a valid clang-cl compiler in the environment, but the former returned true while the later gave false.Moreover, this leads to the absense of
subsystem:console
linker flag incatch2
in xmake-repo.Expected Behavior
The bahavior should be consistent, which both return value should be true.
Project Configuration
I used a modified version of
catch2.lua
in xmake-repo, and a minimalxmake.lua
to reproduce it. I use--cc=clang-cl --cxx=clang-cl
to enforce compiler to be clang-cl:xmake.lua:
catch2mod.lua:
Additional Information and Error Logs
gives:
The text was updated successfully, but these errors were encountered: