From 31e29aff46694de65721781f8e5085d3a4041ea9 Mon Sep 17 00:00:00 2001 From: ruki Date: Sat, 14 Mar 2020 12:51:00 +0800 Subject: fix repeat objectfiles --- tests/apis/rules/xmake.lua | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'tests/apis/rules') diff --git a/tests/apis/rules/xmake.lua b/tests/apis/rules/xmake.lua index 712a055ef..2b3413922 100644 --- a/tests/apis/rules/xmake.lua +++ b/tests/apis/rules/xmake.lua @@ -25,7 +25,10 @@ rule("c code") before_build_file(function (target, sourcefile) print("before_build_file: ", sourcefile) end) - on_build_file(function (target, sourcefile) + on_build_file(function (target, sourcefile, opt) + import("core.theme.theme") + local progress_prefix = "${color.build.progress}" .. theme.get("text.build.progress_format") .. ":${clear} " + cprint(progress_prefix .. "compiling.$(mode) %s", opt.progress, sourcefile) local objectfile_o = os.tmpfile() .. ".o" local sourcefile_c = os.tmpfile() .. ".c" os.cp(sourcefile, sourcefile_c) @@ -143,3 +146,8 @@ target("test") add_files("src/man/*.in", {rule = "man"}) add_files("src/index.md") add_files("src/test.c.in", {rule = "c code"}) + + on_load(function (target) + print(target:sourcefiles()) + print(target:objectfiles()) + end) -- cgit v1.3.1