summaryrefslogtreecommitdiff
path: root/xmake/scripts/platform/windows/tools/cl.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2015-06-23 11:50:04 +0800
committerruki <[email protected]>2015-06-23 11:50:04 +0800
commitdd69dd7eb7b7dac822900f6135fd5236cf39fa12 (patch)
tree7d0a0decffb4a8b77a0e1d9995c6f192b60c8d47 /xmake/scripts/platform/windows/tools/cl.lua
parenta49bed2da5116dde09989a91fc04e9c37fb11740 (diff)
support c99 for windows
Diffstat (limited to 'xmake/scripts/platform/windows/tools/cl.lua')
-rw-r--r--xmake/scripts/platform/windows/tools/cl.lua11
1 files changed, 5 insertions, 6 deletions
diff --git a/xmake/scripts/platform/windows/tools/cl.lua b/xmake/scripts/platform/windows/tools/cl.lua
index e6306fccb..fa961273b 100644
--- a/xmake/scripts/platform/windows/tools/cl.lua
+++ b/xmake/scripts/platform/windows/tools/cl.lua
@@ -35,11 +35,8 @@ function cl.init(self, name)
-- save name
self._NAME = name or "cl.exe"
- -- init cflags
- self.cflags = { "-nologo" }
-
- -- init cxxflags
- self.cxxflags = { "-nologo" }
+ -- init cxflags
+ self.cxflags = { "-nologo", "-Gd", "-MP4", "-D_MBCS", "-D_CRT_SECURE_NO_WARNINGS"}
-- init flags map
self.mapflags =
@@ -55,7 +52,7 @@ function cl.init(self, name)
, ["-fvisibility=.*"] = ""
-- warnings
- , ["-Wall"] = "-Wall"
+ , ["-Wall"] = "-W3" -- = "-Wall" will enable too more warnings
, ["-W1"] = "-W1"
, ["-W2"] = "-W2"
, ["-W3"] = "-W3"
@@ -74,6 +71,8 @@ function cl.init(self, name)
-- language
, ["-ansi"] = ""
+ , ["-std=c99"] = "-TP" -- compile as c++ files because msvc only support c89
+ , ["-std=gnu99"] = "-TP" -- compile as c++ files because msvc only support c89
, ["-std=.*"] = ""
-- others