summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2022-07-02 00:54:52 +0800
committerruki <[email protected]>2022-07-02 00:54:52 +0800
commitb9ecb6ba01262703fd962353fcc24cf0ee7e9e5f (patch)
treeb1165ad2326f98518bf93e80ea858ce5d5424540
parent5708a5c03d35f8761c3d6d07bbb3f6149a879f23 (diff)
add c++ build optimization rule stub
-rw-r--r--xmake/rules/c++/build_optimization/load.lua22
-rw-r--r--xmake/rules/c++/build_optimization/xmake.lua32
-rw-r--r--xmake/rules/c++/xmake.lua4
3 files changed, 56 insertions, 2 deletions
diff --git a/xmake/rules/c++/build_optimization/load.lua b/xmake/rules/c++/build_optimization/load.lua
new file mode 100644
index 000000000..eb9fe3863
--- /dev/null
+++ b/xmake/rules/c++/build_optimization/load.lua
@@ -0,0 +1,22 @@
+--!A cross-platform build utility based on Lua
+--
+-- Licensed under the Apache License, Version 2.0 (the "License");
+-- you may not use this file except in compliance with the License.
+-- You may obtain a copy of the License at
+--
+-- http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+--
+-- Copyright (C) 2015-present, TBOOX Open Source Group.
+--
+-- @author ruki
+-- @file load.lua
+--
+
+function main(target, sourcekind)
+end
diff --git a/xmake/rules/c++/build_optimization/xmake.lua b/xmake/rules/c++/build_optimization/xmake.lua
new file mode 100644
index 000000000..c08b74141
--- /dev/null
+++ b/xmake/rules/c++/build_optimization/xmake.lua
@@ -0,0 +1,32 @@
+--!A cross-platform build utility based on Lua
+--
+-- Licensed under the Apache License, Version 2.0 (the "License");
+-- you may not use this file except in compliance with the License.
+-- You may obtain a copy of the License at
+--
+-- http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+--
+-- Copyright (C) 2015-present, TBOOX Open Source Group.
+--
+-- @author ruki
+-- @file xmake.lua
+--
+
+-- define rule: c.build.optimization
+rule("c.build.optimization")
+ on_config(function (target)
+ import("load")(target, "cc")
+ end)
+
+-- define rule: c++.build.optimization
+rule("c++.build.optimization")
+ on_config(function (target)
+ import("load")(target, "cxx")
+ end)
+
diff --git a/xmake/rules/c++/xmake.lua b/xmake/rules/c++/xmake.lua
index 4fd167722..9ec8f57c4 100644
--- a/xmake/rules/c++/xmake.lua
+++ b/xmake/rules/c++/xmake.lua
@@ -25,7 +25,7 @@ rule("c.build.pcheader")
rule("c.build")
set_sourcekinds("cc")
- add_deps("c.build.pcheader")
+ add_deps("c.build.pcheader", "c.build.optimization")
on_build_files("private.action.build.object", {batch = true, distcc = true})
rule("c++.build.pcheader")
@@ -35,7 +35,7 @@ rule("c++.build.pcheader")
rule("c++.build")
set_sourcekinds("cxx")
- add_deps("c++.build.pcheader", "c++.build.modules")
+ add_deps("c++.build.pcheader", "c++.build.modules", "c++.build.optimization")
on_build_files("private.action.build.object", {batch = true, distcc = true})
rule("c++")