@@ -264,6 +264,8 @@ def build_a_library(self, build_info, lib_name, libraries):
264
264
if include_dirs is None :
265
265
include_dirs = []
266
266
extra_postargs = build_info .get ('extra_compiler_args' ) or []
267
+ extra_cflags = build_info .get ('extra_cflags' ) or []
268
+ extra_cxxflags = build_info .get ('extra_cxxflags' ) or []
267
269
268
270
include_dirs .extend (get_numpy_include_dirs ())
269
271
# where compiled F90 module files are:
@@ -315,41 +317,45 @@ def build_a_library(self, build_info, lib_name, libraries):
315
317
macros = macros + copt_macros ,
316
318
include_dirs = include_dirs ,
317
319
debug = self .debug ,
318
- extra_postargs = extra_postargs ,
320
+ extra_postargs = extra_postargs + extra_cxxflags ,
319
321
ccompiler = cxx_compiler
320
322
)
321
323
322
324
if copt_c_sources :
323
325
log .info ("compiling C dispatch-able sources" )
324
- objects += self .compiler_opt .try_dispatch (copt_c_sources ,
325
- output_dir = self .build_temp ,
326
- src_dir = copt_build_src ,
327
- macros = macros + copt_macros ,
328
- include_dirs = include_dirs ,
329
- debug = self .debug ,
330
- extra_postargs = extra_postargs )
326
+ objects += self .compiler_opt .try_dispatch (
327
+ copt_c_sources ,
328
+ output_dir = self .build_temp ,
329
+ src_dir = copt_build_src ,
330
+ macros = macros + copt_macros ,
331
+ include_dirs = include_dirs ,
332
+ debug = self .debug ,
333
+ extra_postargs = extra_postargs + extra_cflags )
331
334
332
335
if c_sources :
333
336
log .info ("compiling C sources" )
334
- objects += compiler .compile (c_sources ,
335
- output_dir = self .build_temp ,
336
- macros = macros + copt_macros ,
337
- include_dirs = include_dirs ,
338
- debug = self .debug ,
339
- extra_postargs = extra_postargs + copt_baseline_flags )
337
+ objects += compiler .compile (
338
+ c_sources ,
339
+ output_dir = self .build_temp ,
340
+ macros = macros + copt_macros ,
341
+ include_dirs = include_dirs ,
342
+ debug = self .debug ,
343
+ extra_postargs = (extra_postargs +
344
+ copt_baseline_flags +
345
+ extra_cflags ))
340
346
341
347
if cxx_sources :
342
348
log .info ("compiling C++ sources" )
343
349
cxx_compiler = compiler .cxx_compiler ()
344
- cxx_objects = cxx_compiler .compile (cxx_sources ,
345
- output_dir = self . build_temp ,
346
- macros = macros + copt_macros ,
347
- include_dirs = include_dirs ,
348
- debug = self . debug ,
349
- extra_postargs =
350
- [ '-std=c++11' ] +
351
- extra_postargs +
352
- copt_baseline_flags )
350
+ cxx_objects = cxx_compiler .compile (
351
+ cxx_sources ,
352
+ output_dir = self . build_temp ,
353
+ macros = macros + copt_macros ,
354
+ include_dirs = include_dirs ,
355
+ debug = self . debug ,
356
+ extra_postargs = ( extra_postargs +
357
+ copt_baseline_flags +
358
+ extra_cxxflags ) )
353
359
objects .extend (cxx_objects )
354
360
355
361
if f_sources or fmodule_sources :
0 commit comments