summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2023-08-29 23:01:26 +0800
committerruki <[email protected]>2023-08-29 23:01:26 +0800
commit404575d33dd364563d0b582c524d6219c1277c49 (patch)
tree69d99704f211e46895ed9a82f7c938651ed54e77
parent990430ca785e293ee81ee39360581fda06de621b (diff)
add cppfront rule
-rw-r--r--tests/projects/cppfront/console/.gitignore (renamed from tests/projects/other/cppfront/.gitignore)0
-rw-r--r--tests/projects/cppfront/console/src/main.cpp2 (renamed from tests/projects/other/cppfront/src/main.cpp2)0
-rw-r--r--tests/projects/cppfront/console/xmake.lua (renamed from tests/projects/other/cppfront/xmake.lua)1
-rw-r--r--xmake/rules/cppfront/xmake.lua38
4 files changed, 39 insertions, 0 deletions
diff --git a/tests/projects/other/cppfront/.gitignore b/tests/projects/cppfront/console/.gitignore
index 152105761..152105761 100644
--- a/tests/projects/other/cppfront/.gitignore
+++ b/tests/projects/cppfront/console/.gitignore
diff --git a/tests/projects/other/cppfront/src/main.cpp2 b/tests/projects/cppfront/console/src/main.cpp2
index 168a1773a..168a1773a 100644
--- a/tests/projects/other/cppfront/src/main.cpp2
+++ b/tests/projects/cppfront/console/src/main.cpp2
diff --git a/tests/projects/other/cppfront/xmake.lua b/tests/projects/cppfront/console/xmake.lua
index 5499ee547..c9744ada5 100644
--- a/tests/projects/other/cppfront/xmake.lua
+++ b/tests/projects/cppfront/console/xmake.lua
@@ -1,6 +1,7 @@
add_rules("mode.debug", "mode.release")
target("test")
+ add_rules("cppfront")
set_kind("binary")
add_files("src/*.cpp2")
diff --git a/xmake/rules/cppfront/xmake.lua b/xmake/rules/cppfront/xmake.lua
new file mode 100644
index 000000000..c6e41137c
--- /dev/null
+++ b/xmake/rules/cppfront/xmake.lua
@@ -0,0 +1,38 @@
+--!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: cppfront.build
+rule("cppfront.build")
+ set_extensions(".cpp2")
+ on_load(function(target)
+ print("load")
+ end)
+ on_build_file(function(target, sourcefile, opt)
+ print("build", sourcefile)
+ end)
+
+-- define rule: cppfront
+rule("cppfront")
+
+ -- add build rules
+ add_deps("c++", "cppfront.build")
+
+ -- inherit links and linkdirs of all dependent targets by default
+ add_deps("utils.inherit.links")