mirror of https://gitlab.com/ita1024/waf.git
changed name for alias exe() to program() in xcode6
This commit is contained in:
parent
9c50a30f94
commit
8b912d2b1f
|
@ -55,7 +55,7 @@ def build(bld):
|
||||||
|
|
||||||
# TODO: support iOS projects
|
# TODO: support iOS projects
|
||||||
|
|
||||||
from waflib import Context, TaskGen, Build, Utils, Errors
|
from waflib import Context, TaskGen, Build, Utils, Errors, Logs
|
||||||
import os, sys
|
import os, sys
|
||||||
|
|
||||||
HEADERS_GLOB = '**/(*.h|*.hpp|*.H|*.inl)'
|
HEADERS_GLOB = '**/(*.h|*.hpp|*.H|*.inl)'
|
||||||
|
@ -602,24 +602,29 @@ class xcode(Build.BuildContext):
|
||||||
files = [self.unique_filereference(PBXFileReference(n.name, n.abspath())) for n in hdrs]
|
files = [self.unique_filereference(PBXFileReference(n.name, n.abspath())) for n in hdrs]
|
||||||
target.add_build_phase(PBXHeadersBuildPhase([PBXBuildFile(f, {'ATTRIBUTES': ('Public',)}) for f in files]))
|
target.add_build_phase(PBXHeadersBuildPhase([PBXBuildFile(f, {'ATTRIBUTES': ('Public',)}) for f in files]))
|
||||||
|
|
||||||
# Install path
|
|
||||||
installpaths = Utils.to_list(getattr(tg, 'install', []))
|
|
||||||
prodbuildfile = PBXBuildFile(target.productReference)
|
|
||||||
for instpath in installpaths:
|
|
||||||
target.add_build_phase(PBXCopyFilesBuildPhase([prodbuildfile], instpath))
|
|
||||||
|
|
||||||
# Merge frameworks and libs into one list, and prefix the frameworks
|
# Merge frameworks and libs into one list, and prefix the frameworks
|
||||||
ld_flags = ['-framework %s' % lib.split('.framework')[0] for lib in Utils.to_list(tg.env.FRAMEWORK)]
|
ld_flags = ['-framework %s' % lib.split('.framework')[0] for lib in Utils.to_list(tg.env.FRAMEWORK)]
|
||||||
ld_flags.extend(Utils.to_list(tg.env.STLIB) + Utils.to_list(tg.env.LIB))
|
ld_flags.extend(Utils.to_list(tg.env.STLIB) + Utils.to_list(tg.env.LIB))
|
||||||
|
|
||||||
# Override target specfic build settings
|
# Override target specfic build settings
|
||||||
bldsettings = {
|
bldsettings = {
|
||||||
'HEADER_SEARCH_PATHS': ['$(inherited)'] + tg.env['INCPATHS'],
|
'HEADER_SEARCH_PATHS': ['$(inherited)'] + tg.env['INCPATHS'],
|
||||||
'LIBRARY_SEARCH_PATHS': ['$(inherited)'] + Utils.to_list(tg.env.LIBPATH) + Utils.to_list(tg.env.STLIBPATH),
|
'LIBRARY_SEARCH_PATHS': ['$(inherited)'] + Utils.to_list(tg.env.LIBPATH) + Utils.to_list(tg.env.STLIBPATH),
|
||||||
'FRAMEWORK_SEARCH_PATHS': ['$(inherited)'] + Utils.to_list(tg.env.FRAMEWORKPATH),
|
'FRAMEWORK_SEARCH_PATHS': ['$(inherited)'] + Utils.to_list(tg.env.FRAMEWORKPATH),
|
||||||
'OTHER_LDFLAGS': r'\n'.join(ld_flags)
|
'OTHER_LDFLAGS': r'\n'.join(ld_flags),
|
||||||
|
'INSTALL_PATH': []
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Install path
|
||||||
|
installpaths = Utils.to_list(getattr(tg, 'install', []))
|
||||||
|
prodbuildfile = PBXBuildFile(target.productReference)
|
||||||
|
for instpath in installpaths:
|
||||||
|
bldsettings['INSTALL_PATH'].append(instpath)
|
||||||
|
target.add_build_phase(PBXCopyFilesBuildPhase([prodbuildfile], instpath))
|
||||||
|
|
||||||
|
if len(bldsettings['INSTALL_PATH']) == 0:
|
||||||
|
del bldsettings['INSTALL_PATH']
|
||||||
|
|
||||||
# The keys represents different build configuration, e.g. Debug, Release and so on..
|
# The keys represents different build configuration, e.g. Debug, Release and so on..
|
||||||
# Insert our generated build settings to all configuration names
|
# Insert our generated build settings to all configuration names
|
||||||
keys = set(settings.keys() + self.env.PROJ_CONFIGURATION.keys())
|
keys = set(settings.keys() + self.env.PROJ_CONFIGURATION.keys())
|
||||||
|
@ -641,10 +646,13 @@ class xcode(Build.BuildContext):
|
||||||
|
|
||||||
def build_target(self, tgtype, *k, **kw):
|
def build_target(self, tgtype, *k, **kw):
|
||||||
"""
|
"""
|
||||||
Provide user-friendly methods to build different target types
|
Provide aliases
|
||||||
E.g. bld.framework(source='..', ...) to build a Framework target.
|
E.g. bld.framework(source='..', ...) to build a Framework target.
|
||||||
E.g. bld.dylib(source='..', ...) to build a Dynamic library target. etc...
|
E.g. bld.dylib(source='..', ...) to build a Dynamic library target. etc...
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
# The following features are needed for this tool's use of
|
||||||
|
# env['INCPATHS'], env['LIB_xxx'] etc.
|
||||||
self.load('ccroot')
|
self.load('ccroot')
|
||||||
kw['features'] = 'cxx cxxprogram'
|
kw['features'] = 'cxx cxxprogram'
|
||||||
kw['target_type'] = tgtype
|
kw['target_type'] = tgtype
|
||||||
|
@ -654,4 +662,7 @@ class xcode(Build.BuildContext):
|
||||||
def framework(self, *k, **kw): return self.build_target('framework', *k, **kw)
|
def framework(self, *k, **kw): return self.build_target('framework', *k, **kw)
|
||||||
def dylib(self, *k, **kw): return self.build_target('dylib', *k, **kw)
|
def dylib(self, *k, **kw): return self.build_target('dylib', *k, **kw)
|
||||||
def stlib(self, *k, **kw): return self.build_target('stlib', *k, **kw)
|
def stlib(self, *k, **kw): return self.build_target('stlib', *k, **kw)
|
||||||
def exe(self, *k, **kw): return self.build_target('exe', *k, **kw)
|
def program(self, *k, **kw): return self.build_target('exe', *k, **kw)
|
||||||
|
def exe(self, *k, **kw):
|
||||||
|
Logs.warn("xcode6: alias 'bld.exe()' has changed name. Use 'bld.program()' instead.")
|
||||||
|
return self.build_target('exe', *k, **kw)
|
||||||
|
|
Loading…
Reference in New Issue