summaryrefslogtreecommitdiff
path: root/tests/projects/c++/modules/test_base.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2024-02-04 09:26:34 +0800
committerGitHub <[email protected]>2024-02-04 09:26:34 +0800
commit794f6db0adafe26f041d31594cc7e516017ede39 (patch)
tree12229197f9169125cc005f76f030355f490688ab /tests/projects/c++/modules/test_base.lua
parentc5a17b3a1af1c1d377cf04c25f5546a3047bfd03 (diff)
Update test_base.lua
Diffstat (limited to 'tests/projects/c++/modules/test_base.lua')
-rw-r--r--tests/projects/c++/modules/test_base.lua17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/projects/c++/modules/test_base.lua b/tests/projects/c++/modules/test_base.lua
index 4c972c7b6..092fbd72f 100644
--- a/tests/projects/c++/modules/test_base.lua
+++ b/tests/projects/c++/modules/test_base.lua
@@ -10,6 +10,23 @@ function _build()
end
end
+function can_build()
+ if is_subhost("windows") then
+ return true
+ elseif is_subhost("msys") then
+ return true
+ elseif is_host("linux") then
+ local gcc = find_tool("gcc", {version = true})
+ if gcc and gcc.version and semver.compare(gcc.version, "11.0") >= 0 then
+ return true
+ end
+ local clang = find_tool("clang", {version = true})
+ if clang and clang.version and semver.compare(clang.version, "14.0") >= 0 then
+ return true
+ end
+ end
+end
+
function main(t)
if is_subhost("windows") then
local clang = find_tool("clang", {version = true})