summaryrefslogtreecommitdiff
path: root/xmake/rules
diff options
context:
space:
mode:
authorruki <[email protected]>2026-01-17 00:38:19 +0800
committerruki <[email protected]>2026-01-17 00:38:19 +0800
commitd2da2792f328eca7cd527f2f878fa91fac307ee3 (patch)
treec5cd0b3ff3f705182b896a2faa1605e2c9981c37 /xmake/rules
parent4d9a7aeaaf2732ee846ee452f46370a29b6de038 (diff)
fix get flag in module support
Diffstat (limited to 'xmake/rules')
-rw-r--r--xmake/rules/c++/modules/gcc/support.lua2
-rw-r--r--xmake/rules/c++/modules/msvc/support.lua2
2 files changed, 2 insertions, 2 deletions
diff --git a/xmake/rules/c++/modules/gcc/support.lua b/xmake/rules/c++/modules/gcc/support.lua
index 112272893..e4e598107 100644
--- a/xmake/rules/c++/modules/gcc/support.lua
+++ b/xmake/rules/c++/modules/gcc/support.lua
@@ -311,7 +311,7 @@ function get_cppversionflag(target)
if cppversionflag == nil then
local compinst = target:compiler("cxx")
local flags = compinst:compflags({target = target})
- cppversionflag = table.find_if(flags, function(v) string.startswith(v, "-std=c++") end) or "-std=c++20"
+ cppversionflag = table.find_if(flags, function(v) return string.startswith(v, "-std=c++") end) or "-std=c++20"
_g.cppversionflag = cppversionflag
end
return cppversionflag or nil
diff --git a/xmake/rules/c++/modules/msvc/support.lua b/xmake/rules/c++/modules/msvc/support.lua
index 1f066de43..98e6a56c9 100644
--- a/xmake/rules/c++/modules/msvc/support.lua
+++ b/xmake/rules/c++/modules/msvc/support.lua
@@ -261,7 +261,7 @@ function get_cppversionflag(target)
if cppversionflag == nil then
local compinst = target:compiler("cxx")
local flags = compinst:compflags({target = target})
- cppversionflag = table.find_if(flags, function(v) string.startswith(v, "/std:c++") end) or "/std:c++latest"
+ cppversionflag = table.find_if(flags, function(v) return string.startswith(v, "/std:c++") end) or "/std:c++latest"
end
return cppversionflag or nil
end