123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113 |
- from waflib import Task, TaskGen
- top = '.'
- out = 'build'
- APPNAME = 'TestProject'
- VERSION = '1.0'
- """
- To create the xcode project files:
- waf configure xcode6
- To configure and build using Waf:
- waf configure build
- This demo will create an XCode project containing
- an App bundle target, a dynamic library target,
- a static library target and an executable target.
- The generated XCode project can then be opened
- and XCode can then build those targets.
- Tested with XCode 8.
- """
- def options(opt):
- opt.load('compiler_cxx xcode6')
- def configure(conf):
-
-
- conf.env.FRAMEWORK_VERSION = '1.0'
- conf.env.ARCHS = 'x86_64'
- conf.env.INSTALL_PATH = '/my/install/path'
-
-
- conf.load('c_config')
- conf.define('NUMBER', 10)
- conf.write_config_header('config.h')
-
- conf.load('compiler_cxx xcode6')
- conf.env.append_value('CXXFLAGS', ['-O2'])
- conf.check(cxxflags='-std=c++11', uselib_store='STD11', mandatory=False)
- def build(bld):
-
- tg = bld.framework(
- includes='include',
-
- source=bld.path.ant_glob('src/MyLib/*.cpp'),
-
-
-
-
- group_files={
- 'Source files': bld.path.ant_glob('src/MyLib/*.cpp|*.m|*.mm'),
- 'Include': bld.path.ant_glob(incl=['include/MyLib/*.h'], dir=True),
- 'Help': ['src/sample.txt']
- },
-
-
- export_headers=bld.path.ant_glob(incl=['include/MyLib/*.h', 'include/MyLib/SupportLib/*.h']),
- target='MyLib',
-
-
-
- install='~/Library/Frameworks'
- )
-
- bld.stlib(
- source=bld.path.ant_glob('src/MyLib/*.cpp'),
- includes = 'include',
- target='MyStaticLib',
- )
-
- bld.program(
- source=['src/test.cpp'],
- includes='include',
- target='MyExe',
- use='MyDynLib STD11'
- )
-
- bld.shlib(
- source=bld.path.ant_glob('src/MyLib/*.cpp'),
- includes='include',
- target='MyDynLib',
- )
-
- tg2 = bld.app(
- source=bld.path.ant_glob('src/*.cpp'),
- includes='include',
- target='MyApp',
- use='MyLib',
- uselib='SDL2',
- cxxflags='-DSOME_DEFINE',
- framework='Cocoa',
-
- settings={"Debug": {"CONFIG_NAME": 'Debug'}}
- )
|