summaryrefslogtreecommitdiff
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
parent571d0614ff5b16c9e9648f8c3a529e9f3bd82c26 (diff)
add build.pcheader rules
-rw-r--r--xmake/rules/asm/xmake.lua4
-rw-r--r--xmake/rules/c++/xmake.lua22
-rw-r--r--xmake/rules/dlang/xmake.lua4
-rw-r--r--xmake/rules/objc++/xmake.lua10
-rw-r--r--xmake/rules/swift/xmake.lua4
5 files changed, 30 insertions, 14 deletions
diff --git a/xmake/rules/asm/xmake.lua b/xmake/rules/asm/xmake.lua
index a60246957..8b89231ee 100644
--- a/xmake/rules/asm/xmake.lua
+++ b/xmake/rules/asm/xmake.lua
@@ -21,8 +21,8 @@
-- define rule: asm.build
rule("asm.build")
set_extensions(".s", ".asm")
- on_build_files(function (target, sourcefiles, opt)
- import("private.action.build.object")(target, sourcefiles, opt)
+ on_build_files(function (target, sourcebatch, opt)
+ import("private.action.build.object")(target, sourcebatch, opt)
end)
-- define rule: asm
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
diff --git a/xmake/rules/dlang/xmake.lua b/xmake/rules/dlang/xmake.lua
index 318fd83c1..37c22523a 100644
--- a/xmake/rules/dlang/xmake.lua
+++ b/xmake/rules/dlang/xmake.lua
@@ -21,8 +21,8 @@
-- define rule: dlang.build
rule("dlang.build")
set_extensions(".d")
- on_build_files(function (target, sourcefiles, opt)
- import("private.action.build.object")(target, sourcefiles, opt)
+ on_build_files(function (target, sourcebatch, opt)
+ import("private.action.build.object")(target, sourcebatch, opt)
end)
-- define rule: dlang
diff --git a/xmake/rules/objc++/xmake.lua b/xmake/rules/objc++/xmake.lua
index dbd3a80ae..412704bcb 100644
--- a/xmake/rules/objc++/xmake.lua
+++ b/xmake/rules/objc++/xmake.lua
@@ -21,15 +21,17 @@
-- define rule: objc.build
rule("objc.build")
set_extensions(".m")
- 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: objc++.build
rule("objc++.build")
set_extensions(".mm")
- 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: objc
diff --git a/xmake/rules/swift/xmake.lua b/xmake/rules/swift/xmake.lua
index a2e9c5b17..59109d19a 100644
--- a/xmake/rules/swift/xmake.lua
+++ b/xmake/rules/swift/xmake.lua
@@ -21,8 +21,8 @@
-- define rule: swift.build
rule("swift.build")
set_extensions(".swift")
- on_build_files(function (target, sourcefiles, opt)
- import("private.action.build.object")(target, sourcefiles, opt)
+ on_build_files(function (target, sourcebatch, opt)
+ import("private.action.build.object")(target, sourcebatch, opt)
end)
-- define rule: swift