summaryrefslogtreecommitdiff
path: root/xmake/rules/c++
diff options
context:
space:
mode:
authorruki <[email protected]>2019-09-01 12:52:36 +0800
committerruki <[email protected]>2019-09-01 12:52:36 +0800
commitd0e1cbfa1f98267c3be7964b2061bb0ee9b16c4c (patch)
tree723ce8f805a2015d72b48a5a5ef1f9a7e2028012 /xmake/rules/c++
parent571d0614ff5b16c9e9648f8c3a529e9f3bd82c26 (diff)
add build.pcheader rules
Diffstat (limited to 'xmake/rules/c++')
-rw-r--r--xmake/rules/c++/xmake.lua22
1 files changed, 18 insertions, 4 deletions
diff --git a/xmake/rules/c++/xmake.lua b/xmake/rules/c++/xmake.lua
index a9eebf265..88b5e80f5 100644
--- a/xmake/rules/c++/xmake.lua
+++ b/xmake/rules/c++/xmake.lua
@@ -18,18 +18,32 @@
-- @file xmake.lua
--
+-- define rule: c.build.pcheader
+rule("c.build.pcheader")
+ before_build(function (target, opt)
+ import("private.action.build.pcheader")(target, "c", opt)
+ end)
+
-- define rule: c.build
rule("c.build")
set_extensions(".c")
- on_build_files(function (target, sourcefiles, opt)
- import("private.action.build.object")(target, sourcefiles, opt)
+ add_deps("c.build.pcheader")
+ on_build_files(function (target, sourcebatch, opt)
+ import("private.action.build.object")(target, sourcebatch, opt)
+ end)
+
+-- define rule: cpp.build.pcheader
+rule("cpp.build.pcheader")
+ before_build(function (target, opt)
+ import("private.action.build.pcheader")(target, "cxx", opt)
end)
-- define rule: cpp.build
rule("cpp.build")
set_extensions(".cpp", ".cc", ".cxx")
- on_build_files(function (target, sourcefiles, opt)
- import("private.action.build.object")(target, sourcefiles, opt)
+ add_deps("cpp.build.pcheader")
+ on_build_files(function (target, sourcebatch, opt)
+ import("private.action.build.object")(target, sourcebatch, opt)
end)
-- define rule: cpp