summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/projects/asm/yasm/src/main.c0
-rw-r--r--tests/projects/asm/yasm/xmake.lua2
-rw-r--r--xmake/core/project/target.lua16
3 files changed, 17 insertions, 1 deletions
diff --git a/tests/projects/asm/yasm/src/main.c b/tests/projects/asm/yasm/src/main.c
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/tests/projects/asm/yasm/src/main.c
diff --git a/tests/projects/asm/yasm/xmake.lua b/tests/projects/asm/yasm/xmake.lua
index f728b2ca1..213944890 100644
--- a/tests/projects/asm/yasm/xmake.lua
+++ b/tests/projects/asm/yasm/xmake.lua
@@ -1,3 +1,3 @@
target("test")
set_kind("binary")
- add_files("src/*.S")
+ add_files("src/*.S", "src/*.c")
diff --git a/xmake/core/project/target.lua b/xmake/core/project/target.lua
index 2054e4ed6..e5d29f36d 100644
--- a/xmake/core/project/target.lua
+++ b/xmake/core/project/target.lua
@@ -1689,6 +1689,12 @@ function _instance:tool(toolkind)
end
end
+ -- attempt to get program from config first
+ if not program then
+ program = config.get(toolkind)
+ toolname = config.get("__toolname_" .. toolkind)
+ end
+
-- get program from target/toolchains
if not program then
local toolchains = self:toolchains()
@@ -1699,6 +1705,16 @@ function _instance:tool(toolkind)
end
end
end
+
+ -- contain toolname? parse it, e.g. '[email protected]'
+ if program and type(program) == "string" then
+ local pos = program:find('@', 1, true)
+ if pos then
+ toolname = program:sub(1, pos - 1)
+ program = program:sub(pos + 1)
+ end
+ end
+
if program then
toolinfo[1] = program
toolinfo[2] = toolname