From 001fb494ea8333ae2499875bd6ddf3ebcf049bc2 Mon Sep 17 00:00:00 2001 From: ruki Date: Thu, 28 Jul 2016 22:17:47 +0800 Subject: check -FS flags for windows --- xmake/tools/cl.lua | 24 +++++++++++++++++++++--- xmake/tools/link.lua | 11 ++++++++--- 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 -- cgit v1.3.1