summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2019-08-31 08:25:44 +0800
committerruki <[email protected]>2019-08-31 08:25:44 +0800
commit245474d027606784de4ef6bce7a3c1a70aaf16b0 (patch)
treeb0d233ab58f830ebff915aa809e00f89987909ed
parentbb3a62022b775dc837cbd15359d6cc56588921ac (diff)
add c.build rule
-rw-r--r--xmake/rules/c++/xmake.lua11
1 files changed, 9 insertions, 2 deletions
diff --git a/xmake/rules/c++/xmake.lua b/xmake/rules/c++/xmake.lua
index fa67f7da5..27d49df2a 100644
--- a/xmake/rules/c++/xmake.lua
+++ b/xmake/rules/c++/xmake.lua
@@ -18,13 +18,20 @@
-- @file xmake.lua
--
+-- define rule: c.build
+rule("c.build")
+ set_extensions(".c")
+ on_build_files(function (target, sourcefiles, opt)
+ import("build.object")(target, sourcefiles, opt)
+ end)
+
-- define rule: cpp.build
rule("cpp.build")
- set_extensions(".c", ".cpp", ".cc", ".cxx")
+ set_extensions(".cpp", ".cc", ".cxx")
on_build_files(function (target, sourcefiles, opt)
import("build.object")(target, sourcefiles, opt)
end)
-- define rule: cpp
rule("cpp")
- add_deps("cpp.build")
+ add_deps("cpp.build", "c.build")