From ca185a3cc835182a9c290bc53bfec505abd60833 Mon Sep 17 00:00:00 2001 From: ruki Date: Sat, 5 Apr 2025 22:15:27 +0800 Subject: update order opt --- xmake/rules/cppfront/xmake.lua | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'xmake/rules/cppfront/xmake.lua') diff --git a/xmake/rules/cppfront/xmake.lua b/xmake/rules/cppfront/xmake.lua index 22663f184..772c59487 100644 --- a/xmake/rules/cppfront/xmake.lua +++ b/xmake/rules/cppfront/xmake.lua @@ -22,7 +22,6 @@ rule("cppfront.build.h2") set_extensions(".h2") on_buildcmd_file(function (target, batchcmds, sourcefile_h2, opt) - -- get cppfront import("lib.detect.find_tool") local cppfront = assert(find_tool("cppfront", {check = "-h"}), "cppfront not found!") @@ -42,12 +41,11 @@ rule("cppfront.build.h2") batchcmds:set_depcache(target:dependfile(sourcefile_h)) end) --- define rule: cppfront.build rule("cppfront.build.cpp2") set_extensions(".cpp2") -- .h2 must compile before .cpp2 - add_deps("cppfront.build.h2", {order = true}) + add_orders("cppfront.build.h2", "cppfront.build.cpp2") on_load(function (target) -- only cppfront source files? we need to patch cxx source kind for linker @@ -64,7 +62,6 @@ rule("cppfront.build.cpp2") end end) on_buildcmd_file(function (target, batchcmds, sourcefile_cpp2, opt) - -- get cppfront import("lib.detect.find_tool") local cppfront = assert(find_tool("cppfront", {check = "-h"}), "cppfront not found!") @@ -84,6 +81,7 @@ rule("cppfront.build.cpp2") batchcmds:add_depfiles(path.join(root_dir, match_h2)) end end + -- add commands local argv = {"-o", path(sourcefile_cpp), path(sourcefile_cpp2)} batchcmds:show_progress(opt.progress, "${color.build.object}compiling.cpp2 %s", sourcefile_cpp2) @@ -97,14 +95,9 @@ rule("cppfront.build.cpp2") batchcmds:set_depcache(target:dependfile(objectfile)) end) - -- define rule: cppfront rule("cppfront") - - -- add_build.h2 rules add_deps("cppfront.build.h2") - - -- add build rules add_deps("cppfront.build.cpp2") -- set compiler runtime, e.g. vs runtime -- cgit v1.3.1