summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2016-07-28 22:17:47 +0800
committerruki <[email protected]>2016-07-28 22:17:47 +0800
commit001fb494ea8333ae2499875bd6ddf3ebcf049bc2 (patch)
tree16cdcb81b4f25cb952c127c9018b42e64824937c
parenta3e62142764c1d0072988b2f6a42e925c1605565 (diff)
check -FS flags for windows
-rwxr-xr-xxmake/tools/cl.lua24
-rwxr-xr-xxmake/tools/link.lua11
2 files changed, 29 insertions, 6 deletions
diff --git a/xmake/tools/cl.lua b/xmake/tools/cl.lua
index 3ba31f18f..b7ce6b9e1 100755
--- a/xmake/tools/cl.lua
+++ b/xmake/tools/cl.lua
@@ -89,17 +89,35 @@ end
-- make the symbol flag
function symbol(level, symbolfile)
+ -- check -FS flags
+ if _g._FS == nil then
+ local ok = try
+ {
+ function ()
+ check("-ZI -FS -Fd" .. os.tmpfile() .. ".pdb")
+ return true
+ end
+ }
+ if ok then
+ _g._FS = true
+ end
+ end
+
-- debug? generate *.pdb file
+ local flags = ""
if level == "debug" then
if symbolfile then
- return "-ZI -FS -Fd" .. symbolfile
+ flags = "-ZI -Fd" .. symbolfile
+ if _g._FS then
+ flags = "-FS " .. flags
+ end
else
- return "-ZI"
+ flags = "-ZI"
end
end
-- none
- return ""
+ return flags
end
-- make the warning flag
diff --git a/xmake/tools/link.lua b/xmake/tools/link.lua
index c606edb74..cacbb3eab 100755
--- a/xmake/tools/link.lua
+++ b/xmake/tools/link.lua
@@ -78,12 +78,17 @@ end
function symbol(level, symbolfile)
-- debug? generate *.pdb file
- if level == "debug" and symbolfile then
- return "-debug -pdb:" .. symbolfile
+ local flags = ""
+ if level == "debug" then
+ if symbolfile then
+ flags = "-debug -pdb:" .. symbolfile
+ else
+ flags = "-debug"
+ end
end
-- none
- return ""
+ return flags
end
-- make the linklib flag