Merge branch 'master' of https://github.com/premake/premake-core
This commit is contained in:
commit
172a96b9cd
@ -35,7 +35,7 @@ project "curl-lib"
|
||||
end
|
||||
end
|
||||
if ca then
|
||||
defines { "CURL_CA_BUNDLE=\\\"" .. ca .. "\\\"" }
|
||||
defines { 'CURL_CA_BUNDLE="' .. ca .. '"' }
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -89,6 +89,7 @@
|
||||
|
||||
function make.esc(value)
|
||||
result = value:gsub("\\", "\\\\")
|
||||
result = result:gsub("\"", "\\\"")
|
||||
result = result:gsub(" ", "\\ ")
|
||||
result = result:gsub("%(", "\\(")
|
||||
result = result:gsub("%)", "\\)")
|
||||
|
@ -481,14 +481,24 @@
|
||||
|
||||
local pch = cfg.pchheader
|
||||
local found = false
|
||||
|
||||
-- test locally in the project folder first (this is the most likely location)
|
||||
local testname = path.join(cfg.project.basedir, pch)
|
||||
if os.isfile(testname) then
|
||||
pch = project.getrelative(cfg.project, testname)
|
||||
found = true
|
||||
else
|
||||
-- else scan in all include dirs.
|
||||
for _, incdir in ipairs(cfg.includedirs) do
|
||||
local testname = path.join(incdir, pch)
|
||||
testname = path.join(incdir, pch)
|
||||
if os.isfile(testname) then
|
||||
pch = project.getrelative(cfg.project, testname)
|
||||
found = true
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if not found then
|
||||
pch = project.getrelative(cfg.project, path.getabsolute(pch))
|
||||
end
|
||||
|
@ -18,7 +18,6 @@
|
||||
|
||||
m.elements.project = function(r)
|
||||
return {
|
||||
p.xmlUtf8,
|
||||
m.projectSchemaDefinitions,
|
||||
m.rule,
|
||||
m.ruleItem,
|
||||
@ -28,6 +27,7 @@
|
||||
end
|
||||
|
||||
function m.generate(r)
|
||||
p.xmlUtf8()
|
||||
p.callArray(m.elements.project, r)
|
||||
p.out('</ProjectSchemaDefinitions>')
|
||||
end
|
||||
|
@ -20,3 +20,28 @@
|
||||
end
|
||||
return base(fname, mode)
|
||||
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
|
@ -95,9 +95,15 @@
|
||||
info.DependentUpon = fname:sub(1, -4)
|
||||
|
||||
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?
|
||||
local basename = fname:sub(1, -4)
|
||||
testname = basename .. ".Designer.cs"
|
||||
if project.hasfile(fcfg.project, testname) then
|
||||
info.SubType = "Form"
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user