From fdd33995a73e871d43409cdb541ebf1ec8cc300b Mon Sep 17 00:00:00 2001 From: DawnManget Date: Tue, 10 May 2022 11:52:42 +0800 Subject: review4: add keil-c51 toolchain & rules --- xmake/rules/c51/xmake.lua | 5 +++-- xmake/toolchains/c51/xmake.lua | 1 - 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/xmake/rules/c51/xmake.lua b/xmake/rules/c51/xmake.lua index c9f65af55..44c2d3483 100644 --- a/xmake/rules/c51/xmake.lua +++ b/xmake/rules/c51/xmake.lua @@ -1,3 +1,4 @@ + rule("c51.static") on_load(function (target) -- we disable checking flags for cross toolchain automatically @@ -13,9 +14,9 @@ rule("c51.static") after_link(function(target, opt) import("core.project.depend") + import("lib.detect.find_tool") + import("utils.progress") depend.on_changed(function() - import("lib.detect.find_tool") - import("utils.progress") local oh = assert(find_tool("oh51"), "oh51 not found") os.iorunv(oh.program, {target:targetfile()}) progress.show(opt.progress, "${color.build.target}generating.$(mode) %s", target:targetfile() .. ".hex") diff --git a/xmake/toolchains/c51/xmake.lua b/xmake/toolchains/c51/xmake.lua index dc24b02ac..d0af24907 100644 --- a/xmake/toolchains/c51/xmake.lua +++ b/xmake/toolchains/c51/xmake.lua @@ -34,7 +34,6 @@ toolchain("c51") import("lib.detect.find_tool") import("detect.sdks.find_c51") local c51 = find_c51() - if c51 and c51.sdkdir and find_tool("c51") then toolchain:config_set("sdkdir", c51.sdkdir) toolchain:configs_save() -- cgit v1.3.1