diff options
| -rw-r--r-- | tests/apis/rules_override_cxx/xmake.lua | 7 | ||||
| -rw-r--r-- | xmake/core/project/rule.lua | 4 |
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) |
