Skip to content

Commit

Permalink
fix generate defines bug for config.h
Browse files Browse the repository at this point in the history
  • Loading branch information
waruqi committed Jun 17, 2016
1 parent 425b795 commit 432fd6a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion xmake/actions/config/config_h.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 432fd6a

Please sign in to comment.