Ensure that all the flags are really passed to CMake

This commit is contained in:
Guilhem Lavaux 2021-06-23 09:02:24 +02:00
parent 793134d1ba
commit a86c9a85c2
2 changed files with 14 additions and 5 deletions

View File

@ -3,7 +3,7 @@ package:
version: "1.2.3" version: "1.2.3"
source: source:
git_rev: 03033b6 git_rev: 793134d
git_url: https://bitbucket.org/glavaux/cosmotool git_url: https://bitbucket.org/glavaux/cosmotool
requirements: requirements:
@ -14,6 +14,8 @@ requirements:
- numpy # [build_platform != target_platform] - numpy # [build_platform != target_platform]
- {{ compiler('c') }} - {{ compiler('c') }}
- {{ compiler('cxx') }} - {{ compiler('cxx') }}
- llvm-openmp # [osx]
- libgomp # [linux]
host: host:
- python - python
@ -36,6 +38,7 @@ requirements:
- pyfftw - pyfftw
- h5py - h5py
- {{ pin_compatible('gsl') }} - {{ pin_compatible('gsl') }}
- llvm-openmp
test: test:
imports: imports:

View File

@ -168,10 +168,16 @@ class BuildCMakeExt(build_ext):
# Below is just an example set of arguments for building Blender as a Python module # Below is just an example set of arguments for building Blender as a Python module
compilers=[] compilers=[]
if "CC" in os.environ: fill_up_settings=[
compilers.append('-DCMAKE_C_COMPILER=' + os.environ["CC"]) ("CMAKE_C_COMPILER", "CC"),
if "CXX" in os.environ: ("CMAKE_CXX_COMPILER", "CXX"),
compilers.append("-DCMAKE_CXX_COMPILER=" + os.environ["CXX"]) ("CMAKE_C_FLAGS", "CFLAGS"),
("CMAKE_EXE_LINKER_FLAGS_INIT", "LDFLAGS"),
("CMAKE_SHARED_LINKER_FLAGS_INIT", "LDFLAGS"),
("CMAKE_MODULE_LINKER_FLAGS_INIT", "LDFLAGS")]
for cmake_flag, os_flag:
if os_flag in os.environ:
compilers.append(f"-D{cmake_flag}={os.environ[os_flag]}")
self.spawn(['cmake', '-H'+SOURCE_DIR, '-B'+self.build_temp, self.spawn(['cmake', '-H'+SOURCE_DIR, '-B'+self.build_temp,
'-DENABLE_OPENMP=ON','-DINTERNAL_BOOST=ON','-DINTERNAL_EIGEN=ON', '-DENABLE_OPENMP=ON','-DINTERNAL_BOOST=ON','-DINTERNAL_EIGEN=ON',