summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2024-02-05 23:56:46 +0800
committerruki <[email protected]>2024-02-05 23:56:46 +0800
commitb78f608ae74c5c0398e9160891fc6bbef08e358f (patch)
treee20d060e3c6c95aaf6606a767c63c03d3e15ccb7
parent832fc8ded7cbe98ab0244b6975d45215615221b0 (diff)
pass shell to cosmocc
-rw-r--r--xmake/modules/core/tools/cosmocc.lua9
-rw-r--r--xmake/modules/core/tools/gcc.lua9
2 files changed, 14 insertions, 4 deletions
diff --git a/xmake/modules/core/tools/cosmocc.lua b/xmake/modules/core/tools/cosmocc.lua
index 978b03395..c412d287b 100644
--- a/xmake/modules/core/tools/cosmocc.lua
+++ b/xmake/modules/core/tools/cosmocc.lua
@@ -30,3 +30,12 @@ end
function nf_strip(self, level)
end
+-- link the target file
+function link(self, objectfiles, targetkind, targetfile, flags, opt)
+ return _super.link(self, objectfiles, targetkind, targetfile, flags, table.join(opt, {shell = true}))
+end
+
+-- compile the source file
+function compile(self, sourcefile, objectfile, dependinfo, flags, opt)
+ return _super.compile(self, sourcefile, objectfile, dependinfo, flags, table.join(opt, {shell = true}))
+end
diff --git a/xmake/modules/core/tools/gcc.lua b/xmake/modules/core/tools/gcc.lua
index e519b376a..d5ae314b7 100644
--- a/xmake/modules/core/tools/gcc.lua
+++ b/xmake/modules/core/tools/gcc.lua
@@ -519,13 +519,14 @@ end
-- maybe we need to use os.vrunv() to show link output when enable verbose information
-- @see https://github.com/xmake-io/xmake/discussions/2916
--
-function link(self, objectfiles, targetkind, targetfile, flags)
+function link(self, objectfiles, targetkind, targetfile, flags, opt)
+ opt = opt or {}
os.mkdir(path.directory(targetfile))
local program, argv = linkargv(self, objectfiles, targetkind, targetfile, flags)
if option.get("verbose") then
- os.execv(program, argv, {envs = self:runenvs()})
+ os.execv(program, argv, {envs = self:runenvs(), shell = opt.shell})
else
- os.vrunv(program, argv, {envs = self:runenvs()})
+ os.vrunv(program, argv, {envs = self:runenvs(), shell = opt.shell})
end
end
@@ -705,7 +706,7 @@ function _compile(self, sourcefile, objectfile, compflags, opt)
opt = opt or {}
local program, argv = compargv(self, sourcefile, objectfile, compflags)
local function _compile_fallback()
- return os.iorunv(program, argv, {envs = self:runenvs()})
+ return os.iorunv(program, argv, {envs = self:runenvs(), shell = opt.shell})
end
local cppinfo
if distcc_build_client.is_distccjob() and distcc_build_client.singleton():has_freejobs() then