Improved ability to override XCode generator
- Removed unused function
This commit is contained in:
parent
2cee14c124
commit
926c7982de
@ -145,100 +145,70 @@
|
|||||||
return types[path.getextension(node.path)] or "text"
|
return types[path.getextension(node.path)] or "text"
|
||||||
end
|
end
|
||||||
|
|
||||||
--
|
xcode.escapeSpecialChars = {
|
||||||
-- Print user configuration references contained in xcodeconfigreferences
|
|
||||||
-- @param offset
|
|
||||||
-- offset used by function _p
|
|
||||||
-- @param cfg
|
|
||||||
-- configuration
|
|
||||||
--
|
|
||||||
|
|
||||||
local function xcodePrintUserConfigReferences(offset, cfg, tr, kind)
|
|
||||||
local referenceName
|
|
||||||
if kind == "project" then
|
|
||||||
referenceName = cfg.xcodeconfigreferenceproject
|
|
||||||
elseif kind == "target" then
|
|
||||||
referenceName = cfg.xcodeconfigreferencetarget
|
|
||||||
end
|
|
||||||
tree.traverse(tr, {
|
|
||||||
onleaf = function(node)
|
|
||||||
filename = node.name
|
|
||||||
if node.id and path.getextension(filename) == ".xcconfig" then
|
|
||||||
if filename == referenceName then
|
|
||||||
_p(offset, 'baseConfigurationReference = %s /* %s */;', node.id, filename)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
}, false)
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
local escapeSpecialChars = {
|
|
||||||
['\n'] = '\\n',
|
['\n'] = '\\n',
|
||||||
['\r'] = '\\r',
|
['\r'] = '\\r',
|
||||||
['\t'] = '\\t',
|
['\t'] = '\\t',
|
||||||
}
|
}
|
||||||
|
|
||||||
local function escapeChar(c)
|
function xcode.escapeChar(c)
|
||||||
return escapeSpecialChars[c] or '\\'..c
|
return xcode.escapeSpecialChars[c] or '\\'..c
|
||||||
end
|
end
|
||||||
|
|
||||||
local function escapeArg(value)
|
function xcode.escapeArg(value)
|
||||||
value = value:gsub('[\'"\\\n\r\t ]', escapeChar)
|
value = value:gsub('[\'"\\\n\r\t ]', xcode.escapeChar)
|
||||||
return value
|
return value
|
||||||
end
|
end
|
||||||
|
|
||||||
local function escapeSetting(value)
|
function xcode.escapeSetting(value)
|
||||||
value = value:gsub('["\\\n\r\t]', escapeChar)
|
value = value:gsub('["\\\n\r\t]', xcode.escapeChar)
|
||||||
return value
|
return value
|
||||||
end
|
end
|
||||||
|
|
||||||
local function stringifySetting(value)
|
function xcode.stringifySetting(value)
|
||||||
value = value..''
|
value = value..''
|
||||||
if not value:match('^[%a%d_./]+$') then
|
if not value:match('^[%a%d_./]+$') then
|
||||||
value = '"'..escapeSetting(value)..'"'
|
value = '"'..xcode.escapeSetting(value)..'"'
|
||||||
end
|
end
|
||||||
return value
|
return value
|
||||||
end
|
end
|
||||||
|
|
||||||
local function customStringifySetting(value)
|
function xcode.customStringifySetting(value)
|
||||||
value = value..''
|
value = value..''
|
||||||
|
|
||||||
local test = value:match('^[%a%d_./%+]+$')
|
local test = value:match('^[%a%d_./%+]+$')
|
||||||
if test then
|
if test then
|
||||||
value = '"'..escapeSetting(value)..'"'
|
value = '"'..xcode.escapeSetting(value)..'"'
|
||||||
end
|
end
|
||||||
return value
|
return value
|
||||||
end
|
end
|
||||||
|
|
||||||
local function printSetting(level, name, value)
|
function xcode.printSetting(level, name, value)
|
||||||
if type(value) == 'function' then
|
if type(value) == 'function' then
|
||||||
value(level, name)
|
value(level, name)
|
||||||
elseif type(value) ~= 'table' then
|
elseif type(value) ~= 'table' then
|
||||||
_p(level, '%s = %s;', stringifySetting(name), stringifySetting(value))
|
_p(level, '%s = %s;', xcode.stringifySetting(name), xcode.stringifySetting(value))
|
||||||
--elseif #value == 1 then
|
--elseif #value == 1 then
|
||||||
--_p(level, '%s = %s;', stringifySetting(name), stringifySetting(value[1]))
|
--_p(level, '%s = %s;', xcode.stringifySetting(name), xcode.stringifySetting(value[1]))
|
||||||
elseif #value >= 1 then
|
elseif #value >= 1 then
|
||||||
_p(level, '%s = (', stringifySetting(name))
|
_p(level, '%s = (', xcode.stringifySetting(name))
|
||||||
for _, item in ipairs(value) do
|
for _, item in ipairs(value) do
|
||||||
_p(level + 1, '%s,', stringifySetting(item))
|
_p(level + 1, '%s,', xcode.stringifySetting(item))
|
||||||
end
|
end
|
||||||
_p(level, ');')
|
_p(level, ');')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function printSettingsTable(level, settings)
|
function xcode.printSettingsTable(level, settings)
|
||||||
-- Maintain alphabetic order to be consistent
|
-- Maintain alphabetic order to be consistent
|
||||||
local keys = table.keys(settings)
|
local keys = table.keys(settings)
|
||||||
table.sort(keys)
|
table.sort(keys)
|
||||||
for _, k in ipairs(keys) do
|
for _, k in ipairs(keys) do
|
||||||
printSetting(level, k, settings[k])
|
xcode.printSetting(level, k, settings[k])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function overrideSettings(settings, overrides)
|
function xcode.overrideSettings(settings, overrides)
|
||||||
if type(overrides) == 'table' then
|
if type(overrides) == 'table' then
|
||||||
for name, value in pairs(overrides) do
|
for name, value in pairs(overrides) do
|
||||||
-- Allow an override to remove a value by using false
|
-- Allow an override to remove a value by using false
|
||||||
@ -420,7 +390,7 @@
|
|||||||
|
|
||||||
if not table.isempty(settings) then
|
if not table.isempty(settings) then
|
||||||
_p('/* Begin PBXBuildFile section */')
|
_p('/* Begin PBXBuildFile section */')
|
||||||
printSettingsTable(2, settings);
|
xcode.printSettingsTable(2, settings);
|
||||||
_p('/* End PBXBuildFile section */')
|
_p('/* End PBXBuildFile section */')
|
||||||
_p('')
|
_p('')
|
||||||
end
|
end
|
||||||
@ -436,7 +406,7 @@
|
|||||||
_p(3,'containerPortal = %s /* %s */;', node.id, path.getrelative(node.parent.parent.project.location, node.path))
|
_p(3,'containerPortal = %s /* %s */;', node.id, path.getrelative(node.parent.parent.project.location, node.path))
|
||||||
_p(3,'proxyType = 2;')
|
_p(3,'proxyType = 2;')
|
||||||
_p(3,'remoteGlobalIDString = %s;', node.project.xcode.projectnode.id)
|
_p(3,'remoteGlobalIDString = %s;', node.project.xcode.projectnode.id)
|
||||||
_p(3,'remoteInfo = %s;', stringifySetting(node.project.xcode.projectnode.name))
|
_p(3,'remoteInfo = %s;', xcode.stringifySetting(node.project.xcode.projectnode.name))
|
||||||
_p(2,'};')
|
_p(2,'};')
|
||||||
end
|
end
|
||||||
settings[node.targetproxyid] = function()
|
settings[node.targetproxyid] = function()
|
||||||
@ -445,14 +415,14 @@
|
|||||||
_p(3,'containerPortal = %s /* %s */;', node.id, path.getrelative(node.parent.parent.project.location, node.path))
|
_p(3,'containerPortal = %s /* %s */;', node.id, path.getrelative(node.parent.parent.project.location, node.path))
|
||||||
_p(3,'proxyType = 1;')
|
_p(3,'proxyType = 1;')
|
||||||
_p(3,'remoteGlobalIDString = %s;', node.project.xcode.projectnode.targetid)
|
_p(3,'remoteGlobalIDString = %s;', node.project.xcode.projectnode.targetid)
|
||||||
_p(3,'remoteInfo = %s;', stringifySetting(node.project.xcode.projectnode.name))
|
_p(3,'remoteInfo = %s;', xcode.stringifySetting(node.project.xcode.projectnode.name))
|
||||||
_p(2,'};')
|
_p(2,'};')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if not table.isempty(settings) then
|
if not table.isempty(settings) then
|
||||||
_p('/* Begin PBXContainerItemProxy section */')
|
_p('/* Begin PBXContainerItemProxy section */')
|
||||||
printSettingsTable(2, settings);
|
xcode.printSettingsTable(2, settings);
|
||||||
_p('/* End PBXContainerItemProxy section */')
|
_p('/* End PBXContainerItemProxy section */')
|
||||||
_p('')
|
_p('')
|
||||||
end
|
end
|
||||||
@ -474,7 +444,7 @@
|
|||||||
if node.kind == "product" then
|
if node.kind == "product" then
|
||||||
settings[node.id] = function(level)
|
settings[node.id] = function(level)
|
||||||
_p(level,'%s /* %s */ = {isa = PBXFileReference; explicitFileType = %s; includeInIndex = 0; name = %s; path = %s; sourceTree = BUILT_PRODUCTS_DIR; };',
|
_p(level,'%s /* %s */ = {isa = PBXFileReference; explicitFileType = %s; includeInIndex = 0; name = %s; path = %s; sourceTree = BUILT_PRODUCTS_DIR; };',
|
||||||
node.id, node.name, xcode.gettargettype(node), stringifySetting(node.name), stringifySetting(path.getname(node.cfg.buildtarget.bundlename ~= "" and node.cfg.buildtarget.bundlename or node.cfg.buildtarget.relpath)))
|
node.id, node.name, xcode.gettargettype(node), xcode.stringifySetting(node.name), xcode.stringifySetting(path.getname(node.cfg.buildtarget.bundlename ~= "" and node.cfg.buildtarget.bundlename or node.cfg.buildtarget.relpath)))
|
||||||
end
|
end
|
||||||
-- is this a project dependency?
|
-- is this a project dependency?
|
||||||
elseif node.parent.parent == tr.projects then
|
elseif node.parent.parent == tr.projects then
|
||||||
@ -484,7 +454,7 @@
|
|||||||
-- this works if we put it like below
|
-- this works if we put it like below
|
||||||
local relpath = path.getrelative(path.getabsolute(tr.project.location), path.getabsolute(node.parent.project.location))
|
local relpath = path.getrelative(path.getabsolute(tr.project.location), path.getabsolute(node.parent.project.location))
|
||||||
_p(level,'%s /* %s */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = %s; path = %s; sourceTree = SOURCE_ROOT; };',
|
_p(level,'%s /* %s */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = %s; path = %s; sourceTree = SOURCE_ROOT; };',
|
||||||
node.parent.id, node.name, customStringifySetting(node.parent.name), stringifySetting(path.join(relpath, node.parent.name)))
|
node.parent.id, node.name, xcode.customStringifySetting(node.parent.name), xcode.stringifySetting(path.join(relpath, node.parent.name)))
|
||||||
end
|
end
|
||||||
-- something else
|
-- something else
|
||||||
else
|
else
|
||||||
@ -536,7 +506,7 @@
|
|||||||
--end
|
--end
|
||||||
end
|
end
|
||||||
_p(level,'%s /* %s */ = {isa = PBXFileReference; %s = %s; name = %s; path = %s; sourceTree = %s; };',
|
_p(level,'%s /* %s */ = {isa = PBXFileReference; %s = %s; name = %s; path = %s; sourceTree = %s; };',
|
||||||
node.id, node.name, xcode.getfiletypekey(node, cfg), xcode.getfiletype(node, cfg), stringifySetting(node.name), stringifySetting(pth), stringifySetting(src))
|
node.id, node.name, xcode.getfiletypekey(node, cfg), xcode.getfiletype(node, cfg), xcode.stringifySetting(node.name), xcode.stringifySetting(pth), xcode.stringifySetting(src))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -544,7 +514,7 @@
|
|||||||
|
|
||||||
if not table.isempty(settings) then
|
if not table.isempty(settings) then
|
||||||
_p('/* Begin PBXFileReference section */')
|
_p('/* Begin PBXFileReference section */')
|
||||||
printSettingsTable(2, settings)
|
xcode.printSettingsTable(2, settings)
|
||||||
_p('/* End PBXFileReference section */')
|
_p('/* End PBXFileReference section */')
|
||||||
_p('')
|
_p('')
|
||||||
end
|
end
|
||||||
@ -622,7 +592,7 @@
|
|||||||
if node.parent == tr.projects then
|
if node.parent == tr.projects then
|
||||||
_p(3,'name = Products;')
|
_p(3,'name = Products;')
|
||||||
else
|
else
|
||||||
_p(3,'name = %s;', stringifySetting(node.name))
|
_p(3,'name = %s;', xcode.stringifySetting(node.name))
|
||||||
|
|
||||||
local vpath = project.getvpath(tr.project, node.name)
|
local vpath = project.getvpath(tr.project, node.name)
|
||||||
|
|
||||||
@ -631,7 +601,7 @@
|
|||||||
if node.parent.path then
|
if node.parent.path then
|
||||||
p = path.getrelative(node.parent.path, node.path)
|
p = path.getrelative(node.parent.path, node.path)
|
||||||
end
|
end
|
||||||
_p(3,'path = %s;', stringifySetting(p))
|
_p(3,'path = %s;', xcode.stringifySetting(p))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -643,13 +613,13 @@
|
|||||||
|
|
||||||
if not table.isempty(settings) then
|
if not table.isempty(settings) then
|
||||||
_p('/* Begin PBXGroup section */')
|
_p('/* Begin PBXGroup section */')
|
||||||
printSettingsTable(2, settings)
|
xcode.printSettingsTable(2, settings)
|
||||||
_p('/* End PBXGroup section */')
|
_p('/* End PBXGroup section */')
|
||||||
_p('')
|
_p('')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function xcode_GetBuildCommands(tr)
|
function xcode.GetBuildCommands(tr)
|
||||||
local buildCommandInfos = {}
|
local buildCommandInfos = {}
|
||||||
tree.traverse(tr, {
|
tree.traverse(tr, {
|
||||||
onnode = function(node)
|
onnode = function(node)
|
||||||
@ -715,7 +685,7 @@
|
|||||||
return buildCommands
|
return buildCommands
|
||||||
end
|
end
|
||||||
|
|
||||||
local function xcode_PBXAggregateOrNativeTarget(tr, pbxTargetName)
|
function xcode.PBXAggregateOrNativeTarget(tr, pbxTargetName)
|
||||||
local kinds = {
|
local kinds = {
|
||||||
Aggregate = {
|
Aggregate = {
|
||||||
"Utility",
|
"Utility",
|
||||||
@ -740,7 +710,7 @@
|
|||||||
|
|
||||||
_p('/* Begin PBX%sTarget section */', pbxTargetName)
|
_p('/* Begin PBX%sTarget section */', pbxTargetName)
|
||||||
|
|
||||||
local buildCommands = xcode_GetBuildCommands(tr)
|
local buildCommands = xcode.GetBuildCommands(tr)
|
||||||
|
|
||||||
for _, node in ipairs(tr.products.children) do
|
for _, node in ipairs(tr.products.children) do
|
||||||
local name = tr.project.name
|
local name = tr.project.name
|
||||||
@ -755,7 +725,7 @@
|
|||||||
|
|
||||||
_p(2,'%s /* %s */ = {', node.targetid, name)
|
_p(2,'%s /* %s */ = {', node.targetid, name)
|
||||||
_p(3,'isa = PBX%sTarget;', pbxTargetName)
|
_p(3,'isa = PBX%sTarget;', pbxTargetName)
|
||||||
_p(3,'buildConfigurationList = %s /* Build configuration list for PBX%sTarget "%s" */;', node.cfgsection, pbxTargetName, escapeSetting(name))
|
_p(3,'buildConfigurationList = %s /* Build configuration list for PBX%sTarget "%s" */;', node.cfgsection, pbxTargetName, xcode.escapeSetting(name))
|
||||||
_p(3,'buildPhases = (')
|
_p(3,'buildPhases = (')
|
||||||
if hasBuildCommands('prebuildcommands') then
|
if hasBuildCommands('prebuildcommands') then
|
||||||
_p(4,'9607AE1010C857E500CD1376 /* Prebuild */,')
|
_p(4,'9607AE1010C857E500CD1376 /* Prebuild */,')
|
||||||
@ -786,7 +756,7 @@
|
|||||||
end
|
end
|
||||||
_p(3,');')
|
_p(3,');')
|
||||||
|
|
||||||
_p(3,'name = %s;', stringifySetting(name))
|
_p(3,'name = %s;', xcode.stringifySetting(name))
|
||||||
|
|
||||||
if pbxTargetName == "Native" then
|
if pbxTargetName == "Native" then
|
||||||
local p
|
local p
|
||||||
@ -796,14 +766,14 @@
|
|||||||
p = "$(HOME)/Applications"
|
p = "$(HOME)/Applications"
|
||||||
end
|
end
|
||||||
if p then
|
if p then
|
||||||
_p(3,'productInstallPath = %s;', stringifySetting(p))
|
_p(3,'productInstallPath = %s;', xcode.stringifySetting(p))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
_p(3,'productName = %s;', stringifySetting(name))
|
_p(3,'productName = %s;', xcode.stringifySetting(name))
|
||||||
if pbxTargetName == "Native" then
|
if pbxTargetName == "Native" then
|
||||||
_p(3,'productReference = %s /* %s */;', node.id, node.name)
|
_p(3,'productReference = %s /* %s */;', node.id, node.name)
|
||||||
_p(3,'productType = %s;', stringifySetting(xcode.getproducttype(node)))
|
_p(3,'productType = %s;', xcode.stringifySetting(xcode.getproducttype(node)))
|
||||||
end
|
end
|
||||||
_p(2,'};')
|
_p(2,'};')
|
||||||
end
|
end
|
||||||
@ -813,12 +783,12 @@
|
|||||||
|
|
||||||
|
|
||||||
function xcode.PBXAggregateTarget(tr)
|
function xcode.PBXAggregateTarget(tr)
|
||||||
xcode_PBXAggregateOrNativeTarget(tr, "Aggregate")
|
xcode.PBXAggregateOrNativeTarget(tr, "Aggregate")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function xcode.PBXNativeTarget(tr)
|
function xcode.PBXNativeTarget(tr)
|
||||||
xcode_PBXAggregateOrNativeTarget(tr, "Native")
|
xcode.PBXAggregateOrNativeTarget(tr, "Native")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@ -883,7 +853,7 @@
|
|||||||
_p(2,'%s /* %s */ = {', node.id, node.name)
|
_p(2,'%s /* %s */ = {', node.id, node.name)
|
||||||
_p(3,'isa = PBXReferenceProxy;')
|
_p(3,'isa = PBXReferenceProxy;')
|
||||||
_p(3,'fileType = %s;', xcode.gettargettype(node))
|
_p(3,'fileType = %s;', xcode.gettargettype(node))
|
||||||
_p(3,'path = %s;', stringifySetting(node.name))
|
_p(3,'path = %s;', xcode.stringifySetting(node.name))
|
||||||
_p(3,'remoteRef = %s /* PBXContainerItemProxy */;', node.parent.productproxyid)
|
_p(3,'remoteRef = %s /* PBXContainerItemProxy */;', node.parent.productproxyid)
|
||||||
_p(3,'sourceTree = BUILT_PRODUCTS_DIR;')
|
_p(3,'sourceTree = BUILT_PRODUCTS_DIR;')
|
||||||
_p(2,'};')
|
_p(2,'};')
|
||||||
@ -893,7 +863,7 @@
|
|||||||
|
|
||||||
if not table.isempty(settings) then
|
if not table.isempty(settings) then
|
||||||
_p('/* Begin PBXReferenceProxy section */')
|
_p('/* Begin PBXReferenceProxy section */')
|
||||||
printSettingsTable(2, settings)
|
xcode.printSettingsTable(2, settings)
|
||||||
_p('/* End PBXReferenceProxy section */')
|
_p('/* End PBXReferenceProxy section */')
|
||||||
_p('')
|
_p('')
|
||||||
end
|
end
|
||||||
@ -958,7 +928,7 @@
|
|||||||
_p(3,');');
|
_p(3,');');
|
||||||
_p(3,'runOnlyForDeploymentPostprocessing = 0;');
|
_p(3,'runOnlyForDeploymentPostprocessing = 0;');
|
||||||
_p(3,'shellPath = /bin/sh;');
|
_p(3,'shellPath = /bin/sh;');
|
||||||
_p(3,'shellScript = %s;', stringifySetting(table.concat(commands, '\n')))
|
_p(3,'shellScript = %s;', xcode.stringifySetting(table.concat(commands, '\n')))
|
||||||
_p(2,'};')
|
_p(2,'};')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -1004,20 +974,20 @@
|
|||||||
_p(level+1,'files = (')
|
_p(level+1,'files = (')
|
||||||
_p(level+1,');')
|
_p(level+1,');')
|
||||||
_p(level+1,'inputPaths = (');
|
_p(level+1,'inputPaths = (');
|
||||||
_p(level+2,'"%s",', escapeSetting(node.relpath))
|
_p(level+2,'"%s",', xcode.escapeSetting(node.relpath))
|
||||||
for v, _ in pairs(inputs) do
|
for v, _ in pairs(inputs) do
|
||||||
_p(level+2,'"%s",', escapeSetting(project.getrelative(tr.project, v)))
|
_p(level+2,'"%s",', xcode.escapeSetting(project.getrelative(tr.project, v)))
|
||||||
end
|
end
|
||||||
_p(level+1,');')
|
_p(level+1,');')
|
||||||
_p(level+1,'name = %s;', stringifySetting('Build "' .. node.name .. '"'))
|
_p(level+1,'name = %s;', xcode.stringifySetting('Build "' .. node.name .. '"'))
|
||||||
_p(level+1,'outputPaths = (')
|
_p(level+1,'outputPaths = (')
|
||||||
for v, _ in pairs(outputs) do
|
for v, _ in pairs(outputs) do
|
||||||
_p(level+2,'"%s",', escapeSetting(project.getrelative (tr.project, v)))
|
_p(level+2,'"%s",', xcode.escapeSetting(project.getrelative (tr.project, v)))
|
||||||
end
|
end
|
||||||
_p(level+1,');')
|
_p(level+1,');')
|
||||||
_p(level+1,'runOnlyForDeploymentPostprocessing = 0;');
|
_p(level+1,'runOnlyForDeploymentPostprocessing = 0;');
|
||||||
_p(level+1,'shellPath = /bin/sh;');
|
_p(level+1,'shellPath = /bin/sh;');
|
||||||
_p(level+1,'shellScript = %s;', stringifySetting(table.concat(commands, '\n')))
|
_p(level+1,'shellScript = %s;', xcode.stringifySetting(table.concat(commands, '\n')))
|
||||||
_p(level,'};')
|
_p(level,'};')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -1029,7 +999,7 @@
|
|||||||
_p('/* Begin PBXShellScriptBuildPhase section */')
|
_p('/* Begin PBXShellScriptBuildPhase section */')
|
||||||
wrapperWritten = true
|
wrapperWritten = true
|
||||||
end
|
end
|
||||||
printSettingsTable(2, settings)
|
xcode.printSettingsTable(2, settings)
|
||||||
end
|
end
|
||||||
|
|
||||||
doblock("9607AE3510C85E7E00CD1376", "Prelink", "prelinkcommands")
|
doblock("9607AE3510C85E7E00CD1376", "Prelink", "prelinkcommands")
|
||||||
@ -1088,7 +1058,7 @@
|
|||||||
|
|
||||||
if not table.isempty(settings) then
|
if not table.isempty(settings) then
|
||||||
_p('/* Begin PBXVariantGroup section */')
|
_p('/* Begin PBXVariantGroup section */')
|
||||||
printSettingsTable(2, settings)
|
xcode.printSettingsTable(2, settings)
|
||||||
_p('/* End PBXVariantGroup section */')
|
_p('/* End PBXVariantGroup section */')
|
||||||
_p('')
|
_p('')
|
||||||
end
|
end
|
||||||
@ -1102,7 +1072,7 @@
|
|||||||
settings[node.parent.targetdependid] = function()
|
settings[node.parent.targetdependid] = function()
|
||||||
_p(2,'%s /* PBXTargetDependency */ = {', node.parent.targetdependid)
|
_p(2,'%s /* PBXTargetDependency */ = {', node.parent.targetdependid)
|
||||||
_p(3,'isa = PBXTargetDependency;')
|
_p(3,'isa = PBXTargetDependency;')
|
||||||
_p(3,'name = %s;', stringifySetting(node.name))
|
_p(3,'name = %s;', xcode.stringifySetting(node.name))
|
||||||
_p(3,'targetProxy = %s /* PBXContainerItemProxy */;', node.parent.targetproxyid)
|
_p(3,'targetProxy = %s /* PBXContainerItemProxy */;', node.parent.targetproxyid)
|
||||||
_p(2,'};')
|
_p(2,'};')
|
||||||
end
|
end
|
||||||
@ -1111,7 +1081,7 @@
|
|||||||
|
|
||||||
if not table.isempty(settings) then
|
if not table.isempty(settings) then
|
||||||
_p('/* Begin PBXTargetDependency section */')
|
_p('/* Begin PBXTargetDependency section */')
|
||||||
printSettingsTable(2, settings)
|
xcode.printSettingsTable(2, settings)
|
||||||
_p('/* End PBXTargetDependency section */')
|
_p('/* End PBXTargetDependency section */')
|
||||||
_p('')
|
_p('')
|
||||||
end
|
end
|
||||||
@ -1181,13 +1151,13 @@
|
|||||||
local filecfg = fileconfig.getconfig(node, cfg)
|
local filecfg = fileconfig.getconfig(node, cfg)
|
||||||
if filecfg and filecfg.flags.ExcludeFromBuild then
|
if filecfg and filecfg.flags.ExcludeFromBuild then
|
||||||
--fileNameList = fileNameList .. " " ..filecfg.name
|
--fileNameList = fileNameList .. " " ..filecfg.name
|
||||||
table.insert(fileNameList, escapeArg(node.name))
|
table.insert(fileNameList, xcode.escapeArg(node.name))
|
||||||
end
|
end
|
||||||
|
|
||||||
--ms new way
|
--ms new way
|
||||||
-- if the file is not in this config file list excluded it from build !!!
|
-- if the file is not in this config file list excluded it from build !!!
|
||||||
--if not cfg.files[node.abspath] then
|
--if not cfg.files[node.abspath] then
|
||||||
-- table.insert(fileNameList, escapeArg(node.name))
|
-- table.insert(fileNameList, xcode.escapeArg(node.name))
|
||||||
--end
|
--end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -1227,14 +1197,14 @@
|
|||||||
--ms not by default ...add it manually if you need it
|
--ms not by default ...add it manually if you need it
|
||||||
--settings['COMBINE_HIDPI_IMAGES'] = 'YES'
|
--settings['COMBINE_HIDPI_IMAGES'] = 'YES'
|
||||||
|
|
||||||
overrideSettings(settings, cfg.xcodebuildsettings)
|
xcode.overrideSettings(settings, cfg.xcodebuildsettings)
|
||||||
|
|
||||||
_p(2,'%s /* %s */ = {', cfg.xcode.targetid, cfg.buildcfg)
|
_p(2,'%s /* %s */ = {', cfg.xcode.targetid, cfg.buildcfg)
|
||||||
_p(3,'isa = XCBuildConfiguration;')
|
_p(3,'isa = XCBuildConfiguration;')
|
||||||
_p(3,'buildSettings = {')
|
_p(3,'buildSettings = {')
|
||||||
printSettingsTable(4, settings)
|
xcode.printSettingsTable(4, settings)
|
||||||
_p(3,'};')
|
_p(3,'};')
|
||||||
printSetting(3, 'name', cfg.buildcfg);
|
xcode.printSetting(3, 'name', cfg.buildcfg);
|
||||||
_p(2,'};')
|
_p(2,'};')
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -1350,7 +1320,7 @@
|
|||||||
|
|
||||||
local escapedDefines = { }
|
local escapedDefines = { }
|
||||||
for i,v in ipairs(cfg.defines) do
|
for i,v in ipairs(cfg.defines) do
|
||||||
escapedDefines[i] = escapeArg(v)
|
escapedDefines[i] = xcode.escapeArg(v)
|
||||||
end
|
end
|
||||||
settings['GCC_PREPROCESSOR_DEFINITIONS'] = escapedDefines
|
settings['GCC_PREPROCESSOR_DEFINITIONS'] = escapedDefines
|
||||||
|
|
||||||
@ -1435,7 +1405,7 @@
|
|||||||
for _, lib in ipairs(config.getlinks(cfg, "dependencies", "object")) do
|
for _, lib in ipairs(config.getlinks(cfg, "dependencies", "object")) do
|
||||||
if (lib.external) then
|
if (lib.external) then
|
||||||
if not xcode.isframework(lib.linktarget.basename) then
|
if not xcode.isframework(lib.linktarget.basename) then
|
||||||
table.insert(flags, "-l" .. escapeArg(lib.linktarget.basename))
|
table.insert(flags, "-l" .. xcode.escapeArg(lib.linktarget.basename))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -1460,14 +1430,14 @@
|
|||||||
settings['WARNING_CFLAGS'] = '-Weverything'
|
settings['WARNING_CFLAGS'] = '-Weverything'
|
||||||
end
|
end
|
||||||
|
|
||||||
overrideSettings(settings, cfg.xcodebuildsettings)
|
xcode.overrideSettings(settings, cfg.xcodebuildsettings)
|
||||||
|
|
||||||
_p(2,'%s /* %s */ = {', cfg.xcode.projectid, cfg.buildcfg)
|
_p(2,'%s /* %s */ = {', cfg.xcode.projectid, cfg.buildcfg)
|
||||||
_p(3,'isa = XCBuildConfiguration;')
|
_p(3,'isa = XCBuildConfiguration;')
|
||||||
_p(3,'buildSettings = {')
|
_p(3,'buildSettings = {')
|
||||||
printSettingsTable(4, settings)
|
xcode.printSettingsTable(4, settings)
|
||||||
_p(3,'};')
|
_p(3,'};')
|
||||||
printSetting(3, 'name', cfg.buildcfg);
|
xcode.printSetting(3, 'name', cfg.buildcfg);
|
||||||
_p(2,'};')
|
_p(2,'};')
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -1490,7 +1460,7 @@
|
|||||||
|
|
||||||
if not table.isempty(settings) then
|
if not table.isempty(settings) then
|
||||||
_p('/* Begin XCBuildConfiguration section */')
|
_p('/* Begin XCBuildConfiguration section */')
|
||||||
printSettingsTable(0, settings)
|
xcode.printSettingsTable(0, settings)
|
||||||
_p('/* End XCBuildConfiguration section */')
|
_p('/* End XCBuildConfiguration section */')
|
||||||
_p('')
|
_p('')
|
||||||
end
|
end
|
||||||
@ -1499,7 +1469,7 @@
|
|||||||
|
|
||||||
function xcode.XCBuildConfigurationList(tr)
|
function xcode.XCBuildConfigurationList(tr)
|
||||||
local wks = tr.project.workspace
|
local wks = tr.project.workspace
|
||||||
local defaultCfgName = stringifySetting(tr.configs[1].buildcfg)
|
local defaultCfgName = xcode.stringifySetting(tr.configs[1].buildcfg)
|
||||||
local settings = {}
|
local settings = {}
|
||||||
|
|
||||||
for _, target in ipairs(tr.products.children) do
|
for _, target in ipairs(tr.products.children) do
|
||||||
@ -1530,6 +1500,6 @@
|
|||||||
end
|
end
|
||||||
|
|
||||||
_p('/* Begin XCConfigurationList section */')
|
_p('/* Begin XCConfigurationList section */')
|
||||||
printSettingsTable(2, settings)
|
xcode.printSettingsTable(2, settings)
|
||||||
_p('/* End XCConfigurationList section */')
|
_p('/* End XCConfigurationList section */')
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user