diff options
| author | Arthur LAURENT <[email protected]> | 2024-01-23 18:22:52 +0100 |
|---|---|---|
| committer | Arthur LAURENT <[email protected]> | 2024-01-26 18:20:57 +0100 |
| commit | e20c6cafdb241ad6f858556c33463da1a092abdc (patch) | |
| tree | 27e4be80b8a1e9c69c1f42149bf2d31daa1d540a /tests/projects/c++/modules/test_base.lua | |
| parent | 445e43b40846b29b9abb1293b32b27b7104f54fa (diff) | |
improve module tests
Diffstat (limited to 'tests/projects/c++/modules/test_base.lua')
| -rw-r--r-- | tests/projects/c++/modules/test_base.lua | 23 |
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 |
