blob: d3f566ae27e328103cf2e0a547b5416216d00600 [file] [log] [blame]
Zhenkai Zhua7e3da72012-12-27 13:45:00 -08001# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
Alexander Afanasyev71b43e72012-12-27 01:03:43 -08002VERSION='0.1'
Zhenkai Zhua7e3da72012-12-27 13:45:00 -08003APPNAME='chronoshare'
4
Alexander Afanasyeve8496a32013-03-03 16:10:43 -08005from waflib import Build, Logs, Utils, Task, TaskGen, Configure
Zhenkai Zhua7e3da72012-12-27 13:45:00 -08006
7def options(opt):
8 opt.add_option('--debug',action='store_true',default=False,dest='debug',help='''debugging mode''')
9 opt.add_option('--test', action='store_true',default=False,dest='_test',help='''build unit tests''')
Alexander Afanasyev71b43e72012-12-27 01:03:43 -080010 opt.add_option('--yes',action='store_true',default=False) # for autoconf/automake/make compatibility
Alexander Afanasyevc507ac22013-01-21 16:01:58 -080011 opt.add_option('--log4cxx', action='store_true',default=False,dest='log4cxx',help='''Compile with log4cxx logging support''')
Alexander Afanasyev5f9d09e2012-12-28 19:43:08 -080012
Alexander Afanasyev5a95a252013-02-25 12:55:48 -080013 if Utils.unversioned_sys_platform () == "darwin":
Zhenkai Zhubb170d42013-02-25 13:48:59 -080014 opt.add_option('--auto-update', action='store_true',default=False,dest='autoupdate',help='''(OSX) Download sparkle framework and enable autoupdate feature''')
Alexander Afanasyev5a95a252013-02-25 12:55:48 -080015
Alexander Afanasyeva98e69c2013-02-24 15:42:45 -080016 opt.load('compiler_c compiler_cxx boost ccnx protoc qt4')
Zhenkai Zhua7e3da72012-12-27 13:45:00 -080017
18def configure(conf):
Alexander Afanasyeva98e69c2013-02-24 15:42:45 -080019 conf.load("compiler_c compiler_cxx")
Zhenkai Zhua7e3da72012-12-27 13:45:00 -080020
Alexander Afanasyeve8496a32013-03-03 16:10:43 -080021 if conf.options.debug:
22 conf.define ('_DEBUG', 1)
23 conf.add_supported_cxxflags (cxxflags = ['-O0',
24 '-Wall',
25 '-Wno-unused-variable',
26 '-g3',
27 '-Wno-unused-private-field', # only clang supports
28 '-fcolor-diagnostics', # only clang supports
29 '-Qunused-arguments' # only clang supports
30 ])
31 else:
Alexander Afanasyevd985a852013-03-04 10:34:33 -080032 conf.add_supported_cxxflags (cxxflags = ['-O3', '-g'])
Alexander Afanasyeve8496a32013-03-03 16:10:43 -080033
Alexander Afanasyeva1b7bb52013-02-26 17:04:02 -080034 # I wish I could use it, but there is some weirdness with boost tests. Give up for now
35 # try:
36 # conf.check(features='cxx cxxprogram', cxxflags="-std=c++11")
37 # conf.env.append_value ('CXXFLAGS', ["-std=c++11"])
38 # except:
39 # try:
40 # conf.check(features='cxx cxxprogram', cxxflags="-std=c++0x")
41 # conf.env.append_value ('CXXFLAGS', ["-std=c++0x"])
42 # except:
43 # conf.fatal ("You compiler doesn't support C++11. You can try GCC >= 4.4 or recent version of Clang.")
44
Alexander Afanasyevf2890632013-01-02 13:40:02 -080045 conf.define ("CHRONOSHARE_VERSION", VERSION)
46
Alexander Afanasyev71b43e72012-12-27 01:03:43 -080047 conf.check_cfg(package='sqlite3', args=['--cflags', '--libs'], uselib_store='SQLITE3', mandatory=True)
Zhenkai Zhubc2f6282013-01-08 16:40:58 -080048 conf.check_cfg(package='libevent', args=['--cflags', '--libs'], uselib_store='LIBEVENT', mandatory=True)
49 conf.check_cfg(package='libevent_pthreads', args=['--cflags', '--libs'], uselib_store='LIBEVENT_PTHREADS', mandatory=True)
50
Alexander Afanasyeva98e69c2013-02-24 15:42:45 -080051 if Utils.unversioned_sys_platform () == "darwin":
Alexander Afanasyev5a95a252013-02-25 12:55:48 -080052 conf.check_cxx(framework_name='Foundation', uselib_store='OSX_FOUNDATION', mandatory=False, compile_filename='test.mm')
Alexander Afanasyeve8496a32013-03-03 16:10:43 -080053 conf.check_cxx(framework_name='AppKit', uselib_store='OSX_APPKIT', mandatory=False, compile_filename='test.mm')
54 conf.check_cxx(framework_name='CoreWLAN', uselib_store='OSX_COREWLAN', define_name='HAVE_COREWLAN',
55 use="OSX_FOUNDATION", mandatory=False, compile_filename='test.mm')
Alexander Afanasyev5a95a252013-02-25 12:55:48 -080056
57 if conf.options.autoupdate:
Zhenkai Zhubb170d42013-02-25 13:48:59 -080058 def check_sparkle(**kwargs):
Alexander Afanasyeve8496a32013-03-03 16:10:43 -080059 conf.check_cxx (framework_name="Sparkle", header_name=["Foundation/Foundation.h", "AppKit/AppKit.h"],
Zhenkai Zhubb170d42013-02-25 13:48:59 -080060 uselib_store='OSX_SPARKLE', define_name='HAVE_SPARKLE', mandatory=True,
Alexander Afanasyeve8496a32013-03-03 16:10:43 -080061 compile_filename='test.mm', use="OSX_FOUNDATION OSX_APPKIT",
Zhenkai Zhubb170d42013-02-25 13:48:59 -080062 **kwargs
63 )
Alexander Afanasyev5a95a252013-02-25 12:55:48 -080064 try:
65 # Try standard paths first
Zhenkai Zhubb170d42013-02-25 13:48:59 -080066 check_sparkle()
Alexander Afanasyev5a95a252013-02-25 12:55:48 -080067 except:
68 try:
69 # Try local path
70 Logs.info ("Check local version of Sparkle framework")
Alexander Afanasyev7c85d572013-02-26 22:06:54 -080071 check_sparkle(cxxflags="-F%s/osx/Frameworks/" % conf.path.abspath(),
72 linkflags="-F%s/osx/Frameworks/" % conf.path.abspath())
73 conf.env.HAVE_LOCAL_SPARKLE = 1
Alexander Afanasyev5a95a252013-02-25 12:55:48 -080074 except:
Alexander Afanasyeva1b7bb52013-02-26 17:04:02 -080075 import urllib, subprocess, os, shutil
Alexander Afanasyeve8496a32013-03-03 16:10:43 -080076 if not os.path.exists('osx/Frameworks/Sparkle.framework'):
77 # Download to local path and retry
78 Logs.info ("Sparkle framework not found, trying to download it to 'build/'")
Alexander Afanasyeva1b7bb52013-02-26 17:04:02 -080079
Alexander Afanasyeve8496a32013-03-03 16:10:43 -080080 urllib.urlretrieve ("http://sparkle.andymatuschak.org/files/Sparkle%201.5b6.zip", "build/Sparkle.zip")
81 if os.path.exists('build/Sparkle.zip'):
82 try:
83 subprocess.check_call (['unzip', '-qq', 'build/Sparkle.zip', '-d', 'build/Sparkle'])
84 os.remove ("build/Sparkle.zip")
85 if not os.path.exists("osx/Frameworks"):
86 os.mkdir ("osx/Frameworks")
87 os.rename ("build/Sparkle/Sparkle.framework", "osx/Frameworks/Sparkle.framework")
88 shutil.rmtree("build/Sparkle", ignore_errors=True)
89
90 check_sparkle(cxxflags="-F%s/osx/Frameworks/" % conf.path.abspath(),
91 linkflags="-F%s/osx/Frameworks/" % conf.path.abspath())
92 conf.env.HAVE_LOCAL_SPARKLE = 1
93 except subprocess.CalledProcessError as e:
94 conf.fatal("Cannot find Sparkle framework. Auto download failed: '%s' returned %s" % (' '.join(e.cmd), e.returncode))
95 except:
96 conf.fatal("Unknown Error happened when auto downloading Sparkle framework")
Alexander Afanasyev5a95a252013-02-25 12:55:48 -080097
Alexander Afanasyev5a95a252013-02-25 12:55:48 -080098 if conf.is_defined('HAVE_SPARKLE'):
99 conf.env.HAVE_SPARKLE = 1 # small cheat for wscript
Alexander Afanasyeva98e69c2013-02-24 15:42:45 -0800100
Zhenkai Zhua7e3da72012-12-27 13:45:00 -0800101 if not conf.check_cfg(package='openssl', args=['--cflags', '--libs'], uselib_store='SSL', mandatory=False):
Alexander Afanasyev5f9d09e2012-12-28 19:43:08 -0800102 libcrypto = conf.check_cc(lib='crypto',
103 header_name='openssl/crypto.h',
104 define_name='HAVE_SSL',
105 uselib_store='SSL')
106 else:
107 conf.define ("HAVE_SSL", 1)
Zhenkai Zhua7e3da72012-12-27 13:45:00 -0800108 if not conf.get_define ("HAVE_SSL"):
109 conf.fatal ("Cannot find SSL libraries")
110
Alexander Afanasyevc507ac22013-01-21 16:01:58 -0800111 if conf.options.log4cxx:
112 conf.check_cfg(package='liblog4cxx', args=['--cflags', '--libs'], uselib_store='LOG4CXX', mandatory=True)
113 conf.define ("HAVE_LOG4CXX", 1)
114
Zhenkai Zhu0a17aea2012-12-28 14:30:22 -0800115 conf.load ('ccnx')
Alexander Afanasyev33206982013-01-09 16:29:29 -0800116
117 conf.load('protoc')
Alexander Afanasyev33206982013-01-09 16:29:29 -0800118
119 conf.load('qt4')
120
Zhenkai Zhua7e3da72012-12-27 13:45:00 -0800121 conf.load('boost')
122
Alexander Afanasyeve1c95042013-02-27 01:02:36 -0800123 conf.check_boost(lib='system test iostreams filesystem regex thread date_time')
Zhenkai Zhua7e3da72012-12-27 13:45:00 -0800124
Alexander Afanasyev71b43e72012-12-27 01:03:43 -0800125 boost_version = conf.env.BOOST_VERSION.split('_')
126 if int(boost_version[0]) < 1 or int(boost_version[1]) < 46:
127 Logs.error ("Minumum required boost version is 1.46")
128 return
129
Zhenkai Zhua7e3da72012-12-27 13:45:00 -0800130 conf.check_ccnx (path=conf.options.ccnx_dir)
Alexander Afanasyeva98e69c2013-02-24 15:42:45 -0800131 conf.define ('CCNX_PATH', conf.env.CCNX_ROOT)
Zhenkai Zhua7e3da72012-12-27 13:45:00 -0800132
Zhenkai Zhua7e3da72012-12-27 13:45:00 -0800133 if conf.options._test:
Alexander Afanasyev9e5a4702013-01-24 13:15:23 -0800134 conf.define ('_TESTS', 1)
Alexander Afanasyev72ac2192013-01-03 19:33:43 -0800135 conf.env.TEST = 1
Zhenkai Zhua7e3da72012-12-27 13:45:00 -0800136
Alexander Afanasyev71b43e72012-12-27 01:03:43 -0800137 conf.write_config_header('src/config.h')
138
Zhenkai Zhua7e3da72012-12-27 13:45:00 -0800139def build (bld):
Zhenkai Zhue8409422013-01-28 12:52:17 -0800140 executor = bld.objects (
141 target = "executor",
142 features = ["cxx"],
143 source = bld.path.ant_glob(['executor/**/*.cc']),
144 use = 'BOOST BOOST_THREAD LIBEVENT LIBEVENT_PTHREADS LOG4CXX',
145 includes = "executor src",
146 )
147
Alexander Afanasyev3f101ec2013-01-17 16:58:03 -0800148 scheduler = bld.objects (
149 target = "scheduler",
Alexander Afanasyev68f2a952013-01-08 14:34:16 -0800150 features = ["cxx"],
Alexander Afanasyev3f101ec2013-01-17 16:58:03 -0800151 source = bld.path.ant_glob(['scheduler/**/*.cc']),
Zhenkai Zhue8409422013-01-28 12:52:17 -0800152 use = 'BOOST BOOST_THREAD LIBEVENT LIBEVENT_PTHREADS LOG4CXX executor',
Zhenkai Zhu1888f742013-01-28 12:47:33 -0800153 includes = "scheduler executor src",
Alexander Afanasyev68f2a952013-01-08 14:34:16 -0800154 )
155
Zhenkai Zhua7e3da72012-12-27 13:45:00 -0800156 libccnx = bld (
Alexander Afanasyev3f101ec2013-01-17 16:58:03 -0800157 target="ccnx",
158 features=['cxx'],
159 source = bld.path.ant_glob(['ccnx/**/*.cc', 'ccnx/**/*.cpp']),
Zhenkai Zhue8409422013-01-28 12:52:17 -0800160 use = 'BOOST BOOST_THREAD SSL CCNX LOG4CXX scheduler executor',
Zhenkai Zhu1888f742013-01-28 12:47:33 -0800161 includes = "ccnx src scheduler executor",
Alexander Afanasyevf2890632013-01-02 13:40:02 -0800162 )
163
Alexander Afanasyeva98e69c2013-02-24 15:42:45 -0800164 adhoc = bld (
165 target = "adhoc",
166 features=['cxx'],
167 includes = "ccnx src",
168 )
169 if Utils.unversioned_sys_platform () == "darwin":
170 adhoc.mac_app = True
171 adhoc.source = 'adhoc/adhoc-osx.mm'
Alexander Afanasyeve33846d2013-02-25 15:26:08 -0800172 adhoc.use = "LOG4CXX OSX_FOUNDATION OSX_COREWLAN"
Alexander Afanasyeva98e69c2013-02-24 15:42:45 -0800173
Alexander Afanasyev3f101ec2013-01-17 16:58:03 -0800174 chornoshare = bld (
175 target="chronoshare",
176 features=['cxx'],
177 source = bld.path.ant_glob(['src/**/*.cc', 'src/**/*.cpp', 'src/**/*.proto']),
Alexander Afanasyeve1c95042013-02-27 01:02:36 -0800178 use = "BOOST BOOST_FILESYSTEM BOOST_DATE_TIME SQLITE3 LOG4CXX scheduler ccnx",
Zhenkai Zhu1888f742013-01-28 12:47:33 -0800179 includes = "ccnx scheduler src executor",
Alexander Afanasyevee7e6132013-01-03 20:03:14 -0800180 )
Alexander Afanasyevb2fe74e2013-01-20 16:06:43 -0800181
Zhenkai Zhu369eff12013-02-05 15:43:49 -0800182 fs_watcher = bld (
183 target = "fs_watcher",
184 features = "qt4 cxx",
185 defines = "WAF",
186 source = bld.path.ant_glob(['fs-watcher/*.cc']),
187 use = "SQLITE3 LOG4CXX scheduler executor QTCORE",
188 includes = "fs-watcher scheduler executor src",
189 )
190
Alexander Afanasyevee7e6132013-01-03 20:03:14 -0800191 # Unit tests
192 if bld.env['TEST']:
193 unittests = bld.program (
194 target="unit-tests",
Zhenkai Zhud1756272013-02-01 17:02:18 -0800195 features = "qt4 cxx cxxprogram",
196 defines = "WAF",
Zhenkai Zhu369eff12013-02-05 15:43:49 -0800197 source = bld.path.ant_glob(['test/*.cc']),
Alexander Afanasyeve1c95042013-02-27 01:02:36 -0800198 use = 'BOOST_TEST BOOST_FILESYSTEM BOOST_DATE_TIME LOG4CXX SQLITE3 QTCORE QTGUI ccnx database fs_watcher chronoshare',
Zhenkai Zhu369eff12013-02-05 15:43:49 -0800199 includes = "ccnx scheduler src executor gui fs-watcher",
Alexander Afanasyev4f62f442013-02-07 22:36:08 -0800200 install_prefix = None,
Alexander Afanasyevee7e6132013-01-03 20:03:14 -0800201 )
Alexander Afanasyevf2890632013-01-02 13:40:02 -0800202
Zhenkai Zhua9a7e1d2013-02-25 18:29:07 -0800203 http_server = bld (
204 target = "http_server",
Zhenkai Zhud9429222013-02-25 22:34:09 -0800205 features = "qt4 cxx",
Zhenkai Zhua9a7e1d2013-02-25 18:29:07 -0800206 source = bld.path.ant_glob(['server/*.cpp']),
Zhenkai Zhud9429222013-02-25 22:34:09 -0800207 includes = "server src .",
208 use = "BOOST QTCORE"
Zhenkai Zhua9a7e1d2013-02-25 18:29:07 -0800209 )
210
Alexander Afanasyeva98e69c2013-02-24 15:42:45 -0800211 qt = bld (
212 target = "ChronoShare",
Alexander Afanasyevcaf48e22013-03-02 22:47:32 -0800213 features = "qt4 cxx cxxprogram html_resources",
Alexander Afanasyeva98e69c2013-02-24 15:42:45 -0800214 defines = "WAF",
Alexander Afanasyevcaf48e22013-03-02 22:47:32 -0800215 source = bld.path.ant_glob(['gui/*.cpp', 'gui/*.cc', 'gui/images.qrc']),
Zhenkai Zhud9429222013-02-25 22:34:09 -0800216 includes = "ccnx scheduler executor fs-watcher gui src adhoc server . ",
Alexander Afanasyevcaf48e22013-03-02 22:47:32 -0800217 use = "BOOST BOOST_FILESYSTEM BOOST_DATE_TIME SQLITE3 QTCORE QTGUI LOG4CXX fs_watcher ccnx database chronoshare http_server",
218
219 html_resources = bld.path.find_dir ("gui/html").ant_glob([
220 '**/*.js', '**/*.png', '**/*.css',
221 '**/*.html', '**/*.gif', '**/*.ico'
222 ]),
Alexander Afanasyeva98e69c2013-02-24 15:42:45 -0800223 )
224
225 if Utils.unversioned_sys_platform () == "darwin":
226 app_plist = '''<?xml version="1.0" encoding="UTF-8"?>
Alexander Afanasyev83a53002013-01-24 11:12:01 -0800227<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
228<plist version="0.9">
229<dict>
230 <key>CFBundlePackageType</key>
231 <string>APPL</string>
232 <key>CFBundleGetInfoString</key>
233 <string>Created by Waf</string>
Zhenkai Zhu3857d712013-02-27 22:51:25 -0800234 <key>CFBundleIdentifier</key>
235 <string>edu.ucla.cs.irl.Chronoshare</string>
Alexander Afanasyev83a53002013-01-24 11:12:01 -0800236 <key>CFBundleSignature</key>
237 <string>????</string>
238 <key>NOTE</key>
239 <string>THIS IS A GENERATED FILE, DO NOT MODIFY</string>
240 <key>CFBundleExecutable</key>
241 <string>%s</string>
242 <key>LSUIElement</key>
243 <string>1</string>
Zhenkai Zhu8e3e9072013-02-28 15:40:51 -0800244 <key>SUPublicDSAKeyFile</key>
245 <string>dsa_pub.pem</string>
Alexander Afanasyev83a53002013-01-24 11:12:01 -0800246</dict>
247</plist>'''
Alexander Afanasyeva98e69c2013-02-24 15:42:45 -0800248 qt.mac_app = "ChronoShare.app"
249 qt.mac_plist = app_plist % "ChronoShare"
250 qt.use += " OSX_FOUNDATION OSX_COREWLAN adhoc"
Alexander Afanasyev83a53002013-01-24 11:12:01 -0800251
Alexander Afanasyev5a95a252013-02-25 12:55:48 -0800252 if bld.env['HAVE_SPARKLE']:
253 qt.use += " OSX_SPARKLE"
254 qt.source += ["osx/auto-update/sparkle-auto-update.mm"]
255 qt.includes += " osx/auto-update"
Alexander Afanasyev7c85d572013-02-26 22:06:54 -0800256 if bld.env['HAVE_LOCAL_SPARKLE']:
257 qt.mac_frameworks = "osx/Frameworks/Sparkle.framework"
Alexander Afanasyev548d38d2013-01-26 16:36:06 -0800258
259 cmdline = bld (
260 target = "csd",
261 features = "qt4 cxx cxxprogram",
262 defines = "WAF",
Zhenkai Zhu369eff12013-02-05 15:43:49 -0800263 source = "cmd/csd.cc",
264 includes = "ccnx scheduler executor gui fs-watcher src . ",
Alexander Afanasyeve1c95042013-02-27 01:02:36 -0800265 use = "BOOST BOOST_FILESYSTEM BOOST_DATE_TIME SQLITE3 QTCORE QTGUI LOG4CXX fs_watcher ccnx database chronoshare"
Alexander Afanasyev548d38d2013-01-26 16:36:06 -0800266 )
267
Alexander Afanasyeveb575e02013-01-26 17:14:51 -0800268 dump_db = bld (
269 target = "dump-db",
270 features = "cxx cxxprogram",
271 source = "cmd/dump-db.cc",
Zhenkai Zhu369eff12013-02-05 15:43:49 -0800272 includes = "ccnx scheduler executor gui fs-watcher src . ",
Alexander Afanasyeve1c95042013-02-27 01:02:36 -0800273 use = "BOOST BOOST_FILESYSTEM BOOST_DATE_TIME SQLITE3 QTCORE LOG4CXX fs_watcher ccnx database chronoshare"
Alexander Afanasyeveb575e02013-01-26 17:14:51 -0800274 )
275
Alexander Afanasyeva98e69c2013-02-24 15:42:45 -0800276from waflib import TaskGen
277@TaskGen.extension('.mm')
278def m_hook(self, node):
279 """Alias .mm files to be compiled the same as .cc files, gcc/clang will do the right thing."""
280 return self.create_compiled_task('cxx', node)
Zhenkai Zhu6b53f932013-03-02 20:46:02 -0800281
Alexander Afanasyevcaf48e22013-03-02 22:47:32 -0800282@TaskGen.extension('.js', '.png', '.css', '.html', '.gif', '.ico')
283def sig_hook(self, node):
284 node.sig=Utils.h_file (node.abspath())
Zhenkai Zhu6b53f932013-03-02 20:46:02 -0800285
Alexander Afanasyevcaf48e22013-03-02 22:47:32 -0800286@TaskGen.feature('html_resources')
287@TaskGen.before_method('process_source')
288def create_qrc_task(self):
289 output = self.bld.path.find_or_declare ("gui/html.qrc")
290 tsk = self.create_task('html_resources', self.html_resources, output)
Alexander Afanasyev1cb641f2013-03-03 17:49:02 -0800291 tsk.base_path = output.parent.get_src ()
292 self.create_rcc_task (output.get_src ())
Alexander Afanasyevcaf48e22013-03-02 22:47:32 -0800293
294class html_resources(Task.Task):
295 color='PINK'
296
297 def __str__ (self):
Alexander Afanasyev1cb641f2013-03-03 17:49:02 -0800298 return "%s: Generating %s\n" % (self.__class__.__name__.replace('_task',''), self.outputs[0].nice_path ())
Alexander Afanasyevcaf48e22013-03-02 22:47:32 -0800299
300 def run (self):
301 out = self.outputs[0]
Alexander Afanasyev9cc6c212013-03-04 12:45:38 -0800302 bld_out = out.get_bld ()
303 src_out = out.get_src ()
304 bld_out.write('<RCC>\n <qresource prefix="/">\n')
Alexander Afanasyevcaf48e22013-03-02 22:47:32 -0800305 for f in self.inputs:
Alexander Afanasyev9cc6c212013-03-04 12:45:38 -0800306 bld_out.write (' <file>%s</file>\n' % f.path_from (self.base_path), 'a')
307 bld_out.write(' </qresource>\n</RCC>', 'a')
Alexander Afanasyev1cb641f2013-03-03 17:49:02 -0800308
Alexander Afanasyev9cc6c212013-03-04 12:45:38 -0800309 src_out.write (bld_out.read(), 'w')
Alexander Afanasyevcaf48e22013-03-02 22:47:32 -0800310 return 0
Alexander Afanasyeve8496a32013-03-03 16:10:43 -0800311
312@Configure.conf
313def add_supported_cxxflags(self, cxxflags):
314 """
315 Check which cxxflags are supported by compiler and add them to env.CXXFLAGS variable
316 """
317 self.start_msg('Checking allowed flags for c++ compiler')
318
319 supportedFlags = []
320 for flag in cxxflags:
321 if self.check_cxx (cxxflags=[flag], mandatory=False):
322 supportedFlags += [flag]
323
324 self.end_msg (' '.join (supportedFlags))
325 self.env.CXXFLAGS += supportedFlags