summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2023-01-04 23:03:03 +0800
committerruki <[email protected]>2023-01-04 23:03:03 +0800
commitc1dcbe82c7f5eadcb167bd152d202cad4afef7a4 (patch)
tree735877c4b552c61ac32043dc15f9f95945f8d157
parent0ec969792ddf1e9b964c2744f146b53e63f79910 (diff)
improve arch for masm32
-rw-r--r--tests/projects/asm/masm32/xmake.lua1
-rw-r--r--xmake/core/tool/toolchain.lua14
-rw-r--r--xmake/toolchains/masm32/xmake.lua2
3 files changed, 14 insertions, 3 deletions
diff --git a/tests/projects/asm/masm32/xmake.lua b/tests/projects/asm/masm32/xmake.lua
index 64f0f00b5..ba0f6d920 100644
--- a/tests/projects/asm/masm32/xmake.lua
+++ b/tests/projects/asm/masm32/xmake.lua
@@ -4,4 +4,3 @@ target("test")
add_files("src/*.asm")
add_files("src/*.rc")
set_toolchains("masm32")
- add_syslinks("user32", "kernel32")
diff --git a/xmake/core/tool/toolchain.lua b/xmake/core/tool/toolchain.lua
index 0ee62b34e..66321dfa4 100644
--- a/xmake/core/tool/toolchain.lua
+++ b/xmake/core/tool/toolchain.lua
@@ -69,12 +69,22 @@ end
-- get toolchain platform
function _instance:plat()
- return self:config("plat")
+ return self._PLAT or self:config("plat")
+end
+
+-- set toolchain platform
+function _instance:plat_set(plat)
+ self._PLAT = plat
end
-- get toolchain architecture
function _instance:arch()
- return self:config("arch")
+ return self._ARCH or self:config("arch")
+end
+
+-- set toolchain architecture
+function _instance:arch_set(arch)
+ self._ARCH = arch
end
-- the current platform is belong to the given platforms?
diff --git a/xmake/toolchains/masm32/xmake.lua b/xmake/toolchains/masm32/xmake.lua
index f4cba74af..b654d8087 100644
--- a/xmake/toolchains/masm32/xmake.lua
+++ b/xmake/toolchains/masm32/xmake.lua
@@ -42,10 +42,12 @@ toolchain("masm32")
end)
on_load(function (toolchain)
+ toolchain:arch_set("x86")
local sdkdir = toolchain:sdkdir()
if sdkdir then
toolchain:add("includedirs", path.join(sdkdir, "include"))
toolchain:add("linkdirs", path.join(sdkdir, "lib"))
end
toolchain:add("asflags", "/coff")
+ toolchain:add("syslinks", "user32", "kernel32")
end)