summaryrefslogtreecommitdiff
path: root/xmake/toolchains
diff options
context:
space:
mode:
authorruki <[email protected]>2023-01-04 22:46:10 +0800
committerruki <[email protected]>2023-01-04 22:46:10 +0800
commit5c8e06ac7c787f5127a8a109c5964aac561bf071 (patch)
treefdecc700b2f59ae4b036dc095ce11f20950e8943 /xmake/toolchains
parentff4fb0bbf49a490bfe51dcb29b7d02a82350ad63 (diff)
add masm32 sdk
Diffstat (limited to 'xmake/toolchains')
-rw-r--r--xmake/toolchains/masm32/xmake.lua50
1 files changed, 50 insertions, 0 deletions
diff --git a/xmake/toolchains/masm32/xmake.lua b/xmake/toolchains/masm32/xmake.lua
new file mode 100644
index 000000000..f0a1ac7a4
--- /dev/null
+++ b/xmake/toolchains/masm32/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 ruki
+-- @file xmake.lua
+--
+
+toolchain("masm32")
+ set_kind("standalone")
+ set_homepage("https://www.masm32.com")
+ set_description("The MASM32 SDK")
+
+ set_toolset("as", "ml.exe")
+ set_toolset("mrc", "rc.exe")
+ set_toolset("ld", "link.exe")
+ set_toolset("sh", "link.exe")
+ set_toolset("ar", "link.exe")
+
+ on_check(function (toolchain)
+ import("lib.detect.find_tool")
+ import("detect.sdks.find_masm32")
+ local masm32 = find_masm32()
+ if masm32 and masm32.sdkdir and masm32.bindir and find_tool("ml.exe", {program = path.join(masm32.bindir, "ml.exe")}) then
+ toolchain:config_set("sdkdir", masm32.sdkdir)
+ toolchain:config_set("bindir", masm32.bindir)
+ toolchain:configs_save()
+ return true
+ end
+ end)
+
+ on_load(function (toolchain)
+ local sdkdir = toolchain:sdkdir()
+ if sdkdir then
+ toolchain:add("includedirs", path.join(sdkdir, "include"))
+ toolchain:add("linkdirs", path.join(sdkdir, "lib"))
+ end
+ end)