summaryrefslogtreecommitdiff
path: root/xmake/scripts
diff options
context:
space:
mode:
authorruki <[email protected]>2015-06-05 13:38:12 +0800
committerruki <[email protected]>2015-06-05 13:38:12 +0800
commitce6af9d93717a57792fc7d371f0fea9c40878c2f (patch)
treead68f1ea18284b12fdc3a364f88350b0ffed7c58 /xmake/scripts
parent9c4c565ef5cba3c668b338ed0066cff0d58e8caa (diff)
fix verbose for makefile
Diffstat (limited to 'xmake/scripts')
-rw-r--r--xmake/scripts/base/makefile.lua4
-rw-r--r--xmake/scripts/platform/macosx/macosx.lua2
-rw-r--r--xmake/scripts/tools/clang.lua26
-rw-r--r--xmake/scripts/tools/echo.lua2
-rw-r--r--xmake/scripts/tools/verbose.lua2
5 files changed, 20 insertions, 16 deletions
diff --git a/xmake/scripts/base/makefile.lua b/xmake/scripts/base/makefile.lua
index 275e15d07..b0658bfed 100644
--- a/xmake/scripts/base/makefile.lua
+++ b/xmake/scripts/base/makefile.lua
@@ -74,7 +74,7 @@ function makefile._make_object(file, target, srcfile, objfile)
-- make body
file:write(string.format("\t@echo %scompiling%s %s\n", utils.ifelse(ccache, "ccache ", ""), mode, srcfile))
- file:write(string.format("\t@xmake l $(VERBOSE) verbose \"%s\"\n", cmd:gsub("%s", "%%20")))
+ file:write(string.format("\t@xmake l $(VERBOSE) verbose \"%s\"\n", cmd:gsub("%s", "%%20"):gsub("=", "%%3d"):gsub("\"", "%%22")))
file:write(string.format("\t@xmake l mkdir %s\n", path.directory(objfile)))
file:write(string.format("\t@%s > %s 2>&1\n", cmd, makefile._LOGFILE))
@@ -156,7 +156,7 @@ function makefile._make_target(file, name, target)
-- make body
local cmd = linker.make(l, target, objfiles, targetfile)
file:write(string.format("\t@echo linking%s %s\n", mode, path.filename(targetfile)))
- file:write(string.format("\t@xmake l $(VERBOSE) verbose \"%s\"\n", cmd:gsub("%s", "%%20")))
+ file:write(string.format("\t@xmake l $(VERBOSE) verbose \"%s\"\n", cmd:gsub("%s", "%%20"):gsub("=", "%%3d"):gsub("\"", "%%22")))
file:write(string.format("\t@xmake l mkdir %s\n", path.directory(targetfile)))
file:write(string.format("\t@%s > %s 2>&1\n", cmd, makefile._LOGFILE))
diff --git a/xmake/scripts/platform/macosx/macosx.lua b/xmake/scripts/platform/macosx/macosx.lua
index 4ccd27951..7b8d40e4d 100644
--- a/xmake/scripts/platform/macosx/macosx.lua
+++ b/xmake/scripts/platform/macosx/macosx.lua
@@ -54,7 +54,7 @@ function macosx.make(configs)
configs.tools.sh = config.get("sh") or "xcrun -sdk macosx clang++"
-- init xcode sdk directory
- configs.xcode_sdkdir = config.get("xcode_dir") .. "/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX" .. config.get("xcode_sdkver") .. ".sdk"
+ configs.xcode_sdkdir = config.get("xcode_dir") .. "/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX" .. config.get("xcode_sdkver") .. ".sdk"
end
-- get the option menu for action: xmake config or global
diff --git a/xmake/scripts/tools/clang.lua b/xmake/scripts/tools/clang.lua
index c11eb822e..0e2ac3dbd 100644
--- a/xmake/scripts/tools/clang.lua
+++ b/xmake/scripts/tools/clang.lua
@@ -45,20 +45,17 @@ function clang.init(name)
else flags_arch = "-arch " .. arch
end
- -- init cflags
- clang.cflags = flags_arch
+ -- init cxflags
+ clang.cxflags = flags_arch
- -- init cxxflags
- clang.cxxflags = flags_arch
-
- -- init mflags
- clang.mflags = flags_arch
-
- -- init mxxflags
- clang.mxxflags = flags_arch
+ -- init mxflags
+ clang.mxflags = flags_arch .. " -fmessage-length=0 -pipe -fpascal-strings"
+ .. " \"-DIBOutlet=__attribute__((iboutlet))\""
+ .. " \"-DIBOutletCollection(ClassName)=__attribute__((iboutletcollection(ClassName)))\""
+ .. " \"-DIBAction=void)__attribute__((ibaction)\""
-- init asflags
- clang.asflags = flags_arch
+ clang.asflags = flags_arch
-- init ldflags
clang.ldflags = flags_arch
@@ -66,6 +63,13 @@ function clang.init(name)
-- init shflags
clang.shflags = flags_arch .. " -dynamiclib"
+ -- suppress warning for the ccache bug
+ local ccache = config.get("ccache")
+ if ccache and ccache == "y" then
+ clang.cxflags = clang.cxflags:append("-Qunused-arguments", " ")
+ clang.mxflags = clang.mxflags:append("-Qunused-arguments", " ")
+ end
+
end
-- make the compile command
diff --git a/xmake/scripts/tools/echo.lua b/xmake/scripts/tools/echo.lua
index 197cebedc..d9ee8f872 100644
--- a/xmake/scripts/tools/echo.lua
+++ b/xmake/scripts/tools/echo.lua
@@ -32,7 +32,7 @@ function echo.main(...)
-- echo all
for _, v in ipairs(...) do
- io.write(string.format("%s ", v:gsub("%%20", " ")))
+ io.write(string.format("%s ", v:gsub("%%20", " "):gsub("%%3d", "="):gsub("%%22", "\"")))
end
io.write("\n")
diff --git a/xmake/scripts/tools/verbose.lua b/xmake/scripts/tools/verbose.lua
index a5fa6e606..fdcfb3e46 100644
--- a/xmake/scripts/tools/verbose.lua
+++ b/xmake/scripts/tools/verbose.lua
@@ -33,7 +33,7 @@ function verbose.main(...)
-- verbose all
if xmake._OPTIONS.verbose then
for _, v in ipairs(...) do
- io.write(string.format("%s ", v:gsub("%%20", " ")))
+ io.write(string.format("%s ", v:gsub("%%20", " "):gsub("%%3d", "="):gsub("%%22", "\"")))
end
io.write("\n")
end