diff options
| author | ruki <[email protected]> | 2020-05-28 23:00:52 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2020-05-28 12:05:14 +0800 |
| commit | 48d424f2621c1eac563d642ef05c5b34c8d12d2c (patch) | |
| tree | c427aacc78ed741641e59ffb0751c35daea1b52a | |
| parent | a447a635a1ee38bc210b4d8d418479f0da3ecc9c (diff) | |
fix target:tool
| -rw-r--r-- | tests/projects/asm/yasm/src/main.c | 0 | ||||
| -rw-r--r-- | tests/projects/asm/yasm/xmake.lua | 2 | ||||
| -rw-r--r-- | xmake/core/project/target.lua | 16 |
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 |
