From 432fd6a40018f4c29e08f1d4cadf1ccc387a0cff Mon Sep 17 00:00:00 2001 From: ruki Date: Fri, 17 Jun 2016 22:35:02 +0800 Subject: [PATCH] fix generate defines bug for config.h --- xmake/actions/config/config_h.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/xmake/actions/config/config_h.lua b/xmake/actions/config/config_h.lua index cdd18c5dc07..585e651d5b1 100755 --- a/xmake/actions/config/config_h.lua +++ b/xmake/actions/config/config_h.lua @@ -80,7 +80,11 @@ function _make_for_target(files, target) if #defines ~= 0 then file:print("// defines") for _, define in ipairs(defines) do - file:print("#define %s 1", define:gsub("=", " "):gsub("%$%((.-)%)", function (w) if w == "prefix" then return prefix end end)) + if define:find("=") then + file:print("#define %s", define:gsub("=", " "):gsub("%$%((.-)%)", function (w) if w == "prefix" then return prefix end end)) + else + file:print("#define %s 1", define:gsub("%$%((.-)%)", function (w) if w == "prefix" then return prefix end end)) + end end file:print("") end