This commit is contained in:
Ben Ratzlaff 2016-05-08 20:23:26 -07:00
commit 172a96b9cd
7 changed files with 53 additions and 11 deletions

View File

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

View File

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

View File

@ -481,14 +481,24 @@
local pch = cfg.pchheader local pch = cfg.pchheader
local found = false local found = false
for _, incdir in ipairs(cfg.includedirs) do
local testname = path.join(incdir, pch) -- test locally in the project folder first (this is the most likely location)
if os.isfile(testname) then local testname = path.join(cfg.project.basedir, pch)
pch = project.getrelative(cfg.project, testname) if os.isfile(testname) then
found = true pch = project.getrelative(cfg.project, testname)
break found = true
else
-- else scan in all include dirs.
for _, incdir in ipairs(cfg.includedirs) do
testname = path.join(incdir, pch)
if os.isfile(testname) then
pch = project.getrelative(cfg.project, testname)
found = true
break
end
end end
end end
if not found then if not found then
pch = project.getrelative(cfg.project, path.getabsolute(pch)) pch = project.getrelative(cfg.project, path.getabsolute(pch))
end end

View File

@ -18,7 +18,6 @@
m.elements.project = function(r) m.elements.project = function(r)
return { return {
p.xmlUtf8,
m.projectSchemaDefinitions, m.projectSchemaDefinitions,
m.rule, m.rule,
m.ruleItem, m.ruleItem,
@ -28,6 +27,7 @@
end end
function m.generate(r) function m.generate(r)
p.xmlUtf8()
p.callArray(m.elements.project, r) p.callArray(m.elements.project, r)
p.out('</ProjectSchemaDefinitions>') p.out('</ProjectSchemaDefinitions>')
end end

View File

@ -20,3 +20,28 @@
end end
return base(fname, mode) return base(fname, mode)
end) end)
--
-- Write content to a new file.
--
function io.writefile(filename, content)
local file = io.open(filename, "w+b")
if file then
file:write(content)
file:close()
return true
end
end
--
-- Read content from new file.
--
function io.readfile(filename)
local file = io.open(filename, "rb")
if file then
local content = file:read("*a")
file:close()
return content
end
end

View File

@ -95,9 +95,15 @@
info.DependentUpon = fname:sub(1, -4) info.DependentUpon = fname:sub(1, -4)
else else
local basename = fname:sub(1, -4)
-- Is there a matching *.xsd?
testname = basename .. ".xsd"
if project.hasfile(fcfg.project, testname) then
info.DependentUpon = testname
end
-- Is there a matching *.Designer.cs? -- Is there a matching *.Designer.cs?
local basename = fname:sub(1, -4)
testname = basename .. ".Designer.cs" testname = basename .. ".Designer.cs"
if project.hasfile(fcfg.project, testname) then if project.hasfile(fcfg.project, testname) then
info.SubType = "Form" info.SubType = "Form"

View File

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