properly escape defines.

This commit is contained in:
Tom van Dijck 2016-05-02 10:18:36 -07:00
parent 921be76b06
commit 1dbc1ea784
3 changed files with 4 additions and 3 deletions

View File

@ -35,7 +35,7 @@ project "curl-lib"
end
end
if ca then
defines { "CURL_CA_BUNDLE=\\\"" .. ca .. "\\\"" }
defines { 'CURL_CA_BUNDLE="' .. ca .. '"' }
end
end

View File

@ -89,6 +89,7 @@
function make.esc(value)
result = value:gsub("\\", "\\\\")
result = result:gsub("\"", "\\\"")
result = result:gsub(" ", "\\ ")
result = result:gsub("%(", "\\(")
result = result:gsub("%)", "\\)")

View File

@ -136,7 +136,7 @@
function gcc.getdefines(defines)
local result = {}
for _, define in ipairs(defines) do
table.insert(result, '-D' .. define)
table.insert(result, '-D' .. p.esc(define))
end
return result
end
@ -144,7 +144,7 @@
function gcc.getundefines(undefines)
local result = {}
for _, undefine in ipairs(undefines) do
table.insert(result, '-U' .. undefine)
table.insert(result, '-U' .. p.esc(undefine))
end
return result
end