summaryrefslogtreecommitdiff
path: root/tests/projects/c++/modules/test_base.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tests/projects/c++/modules/test_base.lua')
-rw-r--r--tests/projects/c++/modules/test_base.lua23
1 files changed, 18 insertions, 5 deletions
diff --git a/tests/projects/c++/modules/test_base.lua b/tests/projects/c++/modules/test_base.lua
index efef15520..08cda468b 100644
--- a/tests/projects/c++/modules/test_base.lua
+++ b/tests/projects/c++/modules/test_base.lua
@@ -12,21 +12,34 @@ end
function main(t)
if is_subhost("windows") then
- os.exec("xmake f -c")
+ local clang = find_tool("clang", {version = true})
+ if clang and clang.version and semver.compare(clang.version, "14.0") >= 0 then
+ os.exec("xmake f --toolchain=clang -c --yes")
+ _build()
+ os.exec("xmake clean -a")
+ os.exec("xmake f --toolchain=clang --cxxflags=\"-stdlib=libc++\" -c --yes")
+ _build()
+ end
+
+ os.exec("xmake clean -a")
+ os.exec("xmake f -c --yes")
+ _build()
+ elseif is_subhost("msys") then
+ os.exec("xmake f -c -p mingw --yes")
_build()
elseif is_host("linux") then
local gcc = find_tool("gcc", {version = true})
- if is_host("linux") and gcc and gcc.version and semver.compare(gcc.version, "11.0") >= 0 then
- os.exec("xmake f -c")
+ if gcc and gcc.version and semver.compare(gcc.version, "11.0") >= 0 then
+ os.exec("xmake f -c --yes")
_build()
end
local clang = find_tool("clang", {version = true})
if clang and clang.version and semver.compare(clang.version, "14.0") >= 0 then
os.exec("xmake clean -a")
- os.exec("xmake f --toolchain=clang -c")
+ os.exec("xmake f --toolchain=clang -c --yes")
_build()
os.exec("xmake clean -a")
- os.exec("xmake f --toolchain=clang --cxxflags=\"-stdlib=libc++\" -c")
+ os.exec("xmake f --toolchain=clang --cxxflags=\"-stdlib=libc++\" -c --yes")
_build()
end
end