summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2020-03-16 23:09:40 +0800
committerruki <[email protected]>2020-03-16 12:58:03 +0800
commit4da8f86e848db294e30b6007bc8029eb21672830 (patch)
tree1a6c5620b74a4f5c3f3b225e96e7ed197b2301b2
parent545cace2e633a3232a7f4565ee596b8114b44942 (diff)
add port flags for arch
-rw-r--r--xmake/platforms/sdcc/load.lua8
-rw-r--r--xmake/platforms/sdcc/xmake.lua4
2 files changed, 10 insertions, 2 deletions
diff --git a/xmake/platforms/sdcc/load.lua b/xmake/platforms/sdcc/load.lua
index 896d73a7f..e15d4daa0 100644
--- a/xmake/platforms/sdcc/load.lua
+++ b/xmake/platforms/sdcc/load.lua
@@ -36,5 +36,13 @@ function main(platform)
platform:add("linkdirs", linkdir)
end
end
+
+ -- add port flags for arch
+ local arch = config.get("arch")
+ if arch then
+ platform:add("cxflags", "-m" .. arch)
+ platform:add("ldflags", "-m" .. arch)
+ platform:add("shflags", "-m" .. arch)
+ end
end
diff --git a/xmake/platforms/sdcc/xmake.lua b/xmake/platforms/sdcc/xmake.lua
index c43e241ed..82dc92e6a 100644
--- a/xmake/platforms/sdcc/xmake.lua
+++ b/xmake/platforms/sdcc/xmake.lua
@@ -25,10 +25,10 @@ platform("sdcc")
set_hosts("macosx", "linux", "windows")
-- set archs
- set_archs("stm8")
+ set_archs("stm8", "mcs51")
-- set formats
- set_formats {static = "$(name).lib", object = "$(name).rel", binary = "$(name)", symbol = "$(name).sym"}
+ set_formats {static = "$(name).lib", object = "$(name).rel", binary = "$(name).bin", symbol = "$(name).sym"}
-- on check project configuration
on_config_check("config")