summaryrefslogtreecommitdiff
path: root/xmake/toolchains
diff options
context:
space:
mode:
authorDawnManget <[email protected]>2022-05-09 22:24:35 +0800
committerDawnManget <[email protected]>2022-05-09 22:24:35 +0800
commita0a57a74cc301468d21f11cd5d78a272cce561b5 (patch)
tree3c905bdf1a18cc188ae73915d3d840ff4e924974 /xmake/toolchains
parent6f789c9db16eadf5c81b63221cddff59988da465 (diff)
add keil-c51 toolchain & rules
Diffstat (limited to 'xmake/toolchains')
-rw-r--r--xmake/toolchains/c51/xmake.lua50
1 files changed, 50 insertions, 0 deletions
diff --git a/xmake/toolchains/c51/xmake.lua b/xmake/toolchains/c51/xmake.lua
new file mode 100644
index 000000000..fd6ef11dd
--- /dev/null
+++ b/xmake/toolchains/c51/xmake.lua
@@ -0,0 +1,50 @@
+--!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 DawnMagnet
+-- @file xmake.lua
+--
+
+toolchain("c51")
+
+set_homepage("https://www.keil.com/c51/")
+set_description("Keil development tools for the 8051 Microcontroller Architecture")
+
+set_kind("cross")
+set_kind("standalone")
+
+set_toolset("cc", "c51")
+set_toolset("cxx", "c51")
+set_toolset("ld", "bl51")
+--set_toolset("ar", "oh51")
+--set_toolset("ex", "armar")
+--set_toolset("as", "a51")
+
+on_check(function (toolchain)
+ --import("lib.detect.find_tool")
+ import("detect.sdks.find_c51")
+ local c51_module = find_c51()
+ import("detect.tools.find_c51")
+ if c51_module and c51_module.sdkdir and find_c51() then
+ toolchain:config_set("sdkdir", c51_module.sdkdir)
+ toolchain:configs_save()
+ return true
+ end
+end)
+
+
+on_load(function (toolchain)
+end) \ No newline at end of file