diff --git a/setup.py b/setup.py index 1d42019..2667de7 100644 --- a/setup.py +++ b/setup.py @@ -56,6 +56,11 @@ class CMakeBuild(build_ext): if not cmake_generator: cmake_args += ["-GNinja"] + # If this is a CI build, make sure not to use any advanced CPU features + if bool(os.environ.get('CI', False)): + print('forcing use of base x86_64 instruction set for CI build') + cmake_args += ['-DCMAKE_CXX_FLAGS=-mtune=x86_64'] + else: # Single config generators are handled "normally" single_config = any(x in cmake_generator for x in {"NMake", "Ninja"}) @@ -84,11 +89,6 @@ class CMakeBuild(build_ext): ] build_args += ["--config", cfg] - # If this is a CI build, make sure not to use any advanced CPU features - if bool(os.environ.get('CI', False)): - cmake_args += ['-DCMAKE_CXX_FLAGS=-mtune=x86_64'] - build_args += ['-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON'] - # Set CMAKE_BUILD_PARALLEL_LEVEL to control the parallel build level # across all generators. if "CMAKE_BUILD_PARALLEL_LEVEL" not in os.environ: