summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xxmake/tools/clang++.lua4
-rwxr-xr-xxmake/tools/clang.lua4
-rwxr-xr-xxmake/tools/g++.lua4
-rwxr-xr-xxmake/tools/gcc.lua9
4 files changed, 13 insertions, 8 deletions
diff --git a/xmake/tools/clang++.lua b/xmake/tools/clang++.lua
index 6b2feaa2f..2a96b8a07 100755
--- a/xmake/tools/clang++.lua
+++ b/xmake/tools/clang++.lua
@@ -24,10 +24,10 @@
inherit("clang")
-- init it
-function init(shellname)
+function init(shellname, kind)
-- init super
- _super.init(shellname or "clang++")
+ _super.init(shellname or "clang++", kind)
end
diff --git a/xmake/tools/clang.lua b/xmake/tools/clang.lua
index 27bce4e3a..479cdd952 100755
--- a/xmake/tools/clang.lua
+++ b/xmake/tools/clang.lua
@@ -24,10 +24,10 @@
inherit("gcc")
-- init it
-function init(shellname)
+function init(shellname, kind)
-- init super
- _super.init(shellname or "clang")
+ _super.init(shellname or "clang", kind)
-- init shflags
_super._g.shflags = { "-dynamiclib", "-fPIC" }
diff --git a/xmake/tools/g++.lua b/xmake/tools/g++.lua
index 7b2837b8e..06f5a8368 100755
--- a/xmake/tools/g++.lua
+++ b/xmake/tools/g++.lua
@@ -24,10 +24,10 @@
inherit("gcc")
-- init it
-function init(shellname)
+function init(shellname, kind)
-- init super
- _super.init(shellname or "g++")
+ _super.init(shellname or "g++", kind)
end
diff --git a/xmake/tools/gcc.lua b/xmake/tools/gcc.lua
index a576618fc..ff8d144d3 100755
--- a/xmake/tools/gcc.lua
+++ b/xmake/tools/gcc.lua
@@ -21,11 +21,14 @@
--
-- init it
-function init(shellname)
+function init(shellname, kind)
-- save the shell name
_g.shellname = shellname or "gcc"
+ -- save the kind
+ _g.kind = kind
+
-- init mxflags
_g.mxflags = { "-fmessage-length=0"
, "-pipe"
@@ -124,7 +127,9 @@ function check(flags)
-- make an stub source file
local objfile = path.join(os.tmpdir(), "xmake.gcc.o")
- local srcfile = path.join(os.tmpdir(), "xmake.gcc.c")
+ local srcfile = path.join(os.tmpdir(), "xmake.gcc.c" .. ifelse(_g.kind == "cxx", "pp", ""))
+
+ -- make stub code
io.write(srcfile, "int main(int argc, char** argv)\n{return 0;}")
-- check it