8000 WIP · numpy/numpy@7dbc175 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7dbc175

Browse files
WIP
1 parent 5a73e3b commit 7dbc175

File tree

3 files changed

+32
-30
lines changed

3 files changed

+32
-30
lines changed

numpy/distutils/command/build_clib.py

Lines changed: 29 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,8 @@ def build_a_library(self, build_info, lib_name, libraries):
264264
if include_dirs is None:
265265
include_dirs = []
266266
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 []
267269

268270
include_dirs.extend(get_numpy_include_dirs())
269271
# where compiled F90 module files are:
@@ -315,41 +317,45 @@ def build_a_library(self, build_info, lib_name, libraries):
315317
macros=macros + copt_macros,
316318
include_dirs=include_dirs,
317319
debug=self.debug,
318-
extra_postargs=extra_postargs,
320+
extra_postargs=extra_postargs + extra_cxxflags,
319321
ccompiler=cxx_compiler
320322
)
321323

322324
if copt_c_sources:
323325
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)
331334

332335
if c_sources:
333336
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))
340346

341347
if cxx_sources:
342348
log.info("compiling C++ sources")
343349
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))
353359
objects.extend(cxx_objects)
354360

355361
if f_sources or fmodule_sources:

numpy/distutils/command/build_ext.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff li 8000 ne numberDiff line change
@@ -492,10 +492,7 @@ def build_extension(self, ext):
492492
macros=macros + copt_macros,
493493
include_dirs=include_dirs,
494494
debug=self.debug,
495-
extra_postargs=
496-
['-std=c++11'] +
497-
extra_args +
498-
copt_baseline_flags,
495+
extra_postargs=extra_args + copt_baseline_flags,
499496
**kws)
500497

501498
extra_postargs = []

setup.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,9 +209,8 @@ def _needs_gcc_c99_flag(obj):
209209
class new_build_clib(build_clib):
210210
def build_a_library(self, build_info, lib_name, libraries):
211211
if _needs_gcc_c99_flag(self):
212-
args = build_info.get('extra_compiler_args') or []
213-
args.append('-std=c99')
214-
build_info['extra_compiler_args'] = args
212+
build_info['extra_cflags'] = ['-std=c99']
213+
build_info['extra_cxxflags'] = ['-std=c++11']
215214
build_clib.build_a_library(self, build_info, lib_name, libraries)
216215

217216
class new_build_ext(build_ext):

0 commit comments

Comments
 (0)
0