summaryrefslogtreecommitdiff
path: root/xmake/scripts
diff options
context:
space:
mode:
authorruki <[email protected]>2015-06-16 14:26:32 +0800
committerruki <[email protected]>2015-06-16 14:26:32 +0800
commit608602d0de1056f856e0b6bfe33b3f5fbe641b63 (patch)
tree845abda197164395b6ed071045d48a15c2b3e201 /xmake/scripts
parentb02e5fc9da96945b0be2452bdbbf5b9801e68b69 (diff)
compile for android and ios ok
Diffstat (limited to 'xmake/scripts')
-rw-r--r--xmake/scripts/action/_build.lua2
-rw-r--r--xmake/scripts/action/_config.lua3
-rw-r--r--xmake/scripts/base/compiler.lua2
-rw-r--r--xmake/scripts/base/io.lua13
-rw-r--r--xmake/scripts/platform/windows/tools/cl.lua14
-rw-r--r--xmake/scripts/platform/windows/tools/link.lua2
-rw-r--r--xmake/scripts/tools/gcc.lua5
7 files changed, 30 insertions, 11 deletions
diff --git a/xmake/scripts/action/_build.lua b/xmake/scripts/action/_build.lua
index bb4cdf1de..9e031f380 100644
--- a/xmake/scripts/action/_build.lua
+++ b/xmake/scripts/action/_build.lua
@@ -71,7 +71,7 @@ function _build.done()
if not makefile.build(target_name) then
-- error
print("")
- io.cat(rule.logfile())
+ io.cat(rule.logfile(), 16)
utils.error("build target: %s failed!\n", target_name)
return false
end
diff --git a/xmake/scripts/action/_config.lua b/xmake/scripts/action/_config.lua
index 851f866a0..449d2bc03 100644
--- a/xmake/scripts/action/_config.lua
+++ b/xmake/scripts/action/_config.lua
@@ -42,6 +42,9 @@ function _config.done()
return false
end
+ -- trace
+ print("configure ...")
+
-- save the configure
if not config.save() then
-- error
diff --git a/xmake/scripts/base/compiler.lua b/xmake/scripts/base/compiler.lua
index bbbc671b6..9a2f9eb43 100644
--- a/xmake/scripts/base/compiler.lua
+++ b/xmake/scripts/base/compiler.lua
@@ -186,6 +186,8 @@ function compiler._addflags_from_target(module, flags, flagnames, target)
-- add the warning flags from the current project
table.join2(flags, compiler._getflags(module, target.warnings, { none = "-w"
+ , less = "-W1"
+ , more = "-W3"
, all = "-Wall"
, error = "-Werror"
}))
diff --git a/xmake/scripts/base/io.lua b/xmake/scripts/base/io.lua
index db7c2b934..c1808f731 100644
--- a/xmake/scripts/base/io.lua
+++ b/xmake/scripts/base/io.lua
@@ -179,15 +179,26 @@ function io.load(filepath)
end
-- cat the given file
-function io.cat(filepath)
+function io.cat(filepath, linecount)
-- open file
local file = io.open(filepath, "r")
if file then
-- show file
+ local count = 1
for line in file:lines() do
+
+ -- show line
print(line)
+
+ -- end?
+ if linecount and count >= linecount then
+ break
+ end
+
+ -- update the line count
+ count = count + 1
end
-- exit file
diff --git a/xmake/scripts/platform/windows/tools/cl.lua b/xmake/scripts/platform/windows/tools/cl.lua
index 6a1b2fa37..0d94f7800 100644
--- a/xmake/scripts/platform/windows/tools/cl.lua
+++ b/xmake/scripts/platform/windows/tools/cl.lua
@@ -59,13 +59,13 @@ function cl.init(self, name)
, ["%-Wno%-error=.*"] = ""
-- vectorexts
- , ["-mmmx"] = "-arch:mmx"
- , ["-msse"] = "-arch:sse"
- , ["-msse2"] = "-arch:sse2"
- , ["-msse3"] = "-arch:sse3"
- , ["-mssse3"] = "-arch:ssse3"
- , ["-mavx"] = "-arch:avx"
- , ["-mavx2"] = "-arch:avx2"
+ , ["-mmmx"] = "-arch:MMX"
+ , ["-msse"] = "-arch:SSE"
+ , ["-msse2"] = "-arch:SSE2"
+ , ["-msse3"] = "-arch:SSE3"
+ , ["-mssse3"] = "-arch:SSSE3"
+ , ["-mavx"] = "-arch:AVX"
+ , ["-mavx2"] = "-arch:AVX2"
, ["-mfpu=.*"] = ""
-- language
diff --git a/xmake/scripts/platform/windows/tools/link.lua b/xmake/scripts/platform/windows/tools/link.lua
index 4a77c9908..7eb56ffc9 100644
--- a/xmake/scripts/platform/windows/tools/link.lua
+++ b/xmake/scripts/platform/windows/tools/link.lua
@@ -49,8 +49,6 @@ function link.init(self, name)
self.ldflags = { "-nologo"
, "-dynamicbase"
, "-nxcompat"
- , "-manifest"
- , "-manifestuac:\"level='asInvoker' uiAccess='false'\""
, flags_arch}
-- init arflags
diff --git a/xmake/scripts/tools/gcc.lua b/xmake/scripts/tools/gcc.lua
index 079a6e932..6a5fc9d82 100644
--- a/xmake/scripts/tools/gcc.lua
+++ b/xmake/scripts/tools/gcc.lua
@@ -99,6 +99,11 @@ function gcc.init(self, name)
, ["-mavx2"] = self._check
, ["-mfpu=.*"] = self._check
+ -- warnings
+ , ["-W1"] = "-Wall"
+ , ["-W2"] = "-Wall"
+ , ["-W3"] = "-Wall"
+
-- others
, ["-ftrapv"] = self._check
, ["-fsanitize=address"] = self._check