summaryrefslogtreecommitdiff
path: root/xmake/core/tool/builder.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2017-07-27 19:27:12 +0800
committerruki <[email protected]>2017-07-27 19:27:12 +0800
commit6f2c9ecd0d7ea9f2fbfab79b6960eb1274ca816a (patch)
tree322b4e7ba82e82ce8a6d0c4b56d044bbcde2d010 /xmake/core/tool/builder.lua
parent84defbee206dd2d810070bfae7b7e269a3445896 (diff)
impl compile pch for gcc
Diffstat (limited to 'xmake/core/tool/builder.lua')
-rw-r--r--xmake/core/tool/builder.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/xmake/core/tool/builder.lua b/xmake/core/tool/builder.lua
index b1269f9ef..23db1044c 100644
--- a/xmake/core/tool/builder.lua
+++ b/xmake/core/tool/builder.lua
@@ -247,13 +247,15 @@ function builder:_addflags_from_language(flags, target)
-- get api name of tool
--
+ -- ignore "nf_" and "_if_ok"
+ --
-- .e.g
--
-- defines => define
-- defines_if_ok => define
-- ...
--
- local apiname = flagname:split('_')[1]
+ local apiname = flagname:gsub("^nf_", ""):gsub("_if_ok$", "")
if apiname:endswith("s") then
apiname = apiname:sub(1, #apiname - 1)
end