summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2022-09-27 23:32:17 +0800
committerruki <[email protected]>2022-09-27 23:32:17 +0800
commit89a12a21daf519d0f9d9cb5846dfe7c4835c97b5 (patch)
tree4f90c9f3cf7395555ab47999076d216e5d483e17
parentb1dd0bd59f5d35717b2493a45bf5a0274fed2a9a (diff)
fix tests
-rw-r--r--tests/apis/rules_override_cxx/xmake.lua7
-rw-r--r--xmake/core/project/rule.lua4
2 files changed, 9 insertions, 2 deletions
diff --git a/tests/apis/rules_override_cxx/xmake.lua b/tests/apis/rules_override_cxx/xmake.lua
index 4b44d2111..812680ef0 100644
--- a/tests/apis/rules_override_cxx/xmake.lua
+++ b/tests/apis/rules_override_cxx/xmake.lua
@@ -18,6 +18,13 @@ rule("xx")
table.insert(sourcebatch.objectfiles, objectfile)
table.insert(sourcebatch.dependfiles, dependfile)
end
+
+ -- force as c++ source file
+ if target:is_plat("windows") then
+ target:add("cxxflags", "/TP")
+ else
+ target:add("cxxflags", "-x c++")
+ end
end)
target("test")
diff --git a/xmake/core/project/rule.lua b/xmake/core/project/rule.lua
index c3403a197..52b8e9ff9 100644
--- a/xmake/core/project/rule.lua
+++ b/xmake/core/project/rule.lua
@@ -67,13 +67,13 @@ function _instance:get(name)
return self._INFO:get(name)
end
--- set the value to the package info
+-- set the value to the rule info
function _instance:set(name, ...)
self._INFO:apival_set(name, ...)
self:_invalidate(name)
end
--- add the value to the package info
+-- add the value to the rule info
function _instance:add(name, ...)
self._INFO:apival_add(name, ...)
self:_invalidate(name)