2
0
mirror of https://gitlab.com/ita1024/waf.git synced 2024-12-24 02:05:12 +01:00

Make xcode6 tool consider standard waf build flags

Build flags like 'cflags', 'cxxflags' passed to xcode6 builds
are now considered by the xcode6 tool. For example, running command 'waf xcode6'
with the following wscript:

cnf.env.CXXFLAGS = ['-std=c++11']
...
bld.program(..., cxxflags='-O3')

now sets the OTHER_CPLUSCPLUSFLAGS in Xcode to '-O3 -std=c++11'
This commit is contained in:
Simon 2017-06-18 12:42:07 +02:00 committed by Thomas Nagy
parent 8289af2b98
commit 73c276c11b
2 changed files with 15 additions and 4 deletions

View File

@ -43,6 +43,8 @@ def configure(conf):
# This must be called at the end of configure()
conf.load('compiler_cxx xcode6')
conf.env.CXXFLAGS='-std=c++11'
conf.check(cxxflags='-std=c++11', uselib_store='STD11', mandatory=False)
def build(bld):

View File

@ -556,15 +556,24 @@ def process_xcode(self):
target.add_build_phase(buildphase)
# 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(self.env.FRAMEWORK)]
ld_flags.extend(Utils.to_list(self.env.STLIB) + Utils.to_list(self.env.LIB))
frameworks = Utils.to_list(self.env.FRAMEWORK)
frameworks = ' '.join(['-framework %s' % (f.split('.framework')[0]) for f in frameworks])
libs = Utils.to_list(self.env.STLIB) + Utils.to_list(self.env.LIB)
libs = ' '.join(bld.env['STLIB_ST'] % t for t in libs)
linkflags = bld.env['LINKFLAGS']
ldflags = bld.env['LDFLAGS']
# Override target specific build settings
bldsettings = {
'HEADER_SEARCH_PATHS': ['$(inherited)'] + self.env['INCPATHS'],
'LIBRARY_SEARCH_PATHS': ['$(inherited)'] + Utils.to_list(self.env.LIBPATH) + Utils.to_list(self.env.STLIBPATH),
'LIBRARY_SEARCH_PATHS': ['$(inherited)'] + Utils.to_list(self.env.LIBPATH) + Utils.to_list(self.env.STLIBPATH) + Utils.to_list(self.env.LIBDIR) ,
'FRAMEWORK_SEARCH_PATHS': ['$(inherited)'] + Utils.to_list(self.env.FRAMEWORKPATH),
'OTHER_LDFLAGS': r'\n'.join(ld_flags),
'OTHER_LDFLAGS': libs + ' ' + frameworks,
'OTHER_LIBTOOLFLAGS': bld.env['LINKFLAGS'],
'OTHER_CPLUSPLUSFLAGS': Utils.to_list(self.env['CXXFLAGS']),
'OTHER_CFLAGS': Utils.to_list(self.env['CFLAGS']),
'INSTALL_PATH': []
}