From d4c91e21b80ea468ade5c0164d35c8f85a5b1e6d Mon Sep 17 00:00:00 2001 From: drewcassidy Date: Mon, 12 Apr 2021 20:07:04 -0700 Subject: [PATCH] test CI-specific build rules --- setup.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 4a92f6b..4c2d105 100644 --- a/setup.py +++ b/setup.py @@ -57,7 +57,6 @@ class CMakeBuild(build_ext): cmake_args += ["-GNinja"] else: - # Single config generators are handled "normally" single_config = any(x in cmake_generator for x in {"NMake", "Ninja"}) @@ -85,6 +84,10 @@ 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'] + # Set CMAKE_BUILD_PARALLEL_LEVEL to control the parallel build level # across all generators. if "CMAKE_BUILD_PARALLEL_LEVEL" not in os.environ: @@ -101,7 +104,7 @@ class CMakeBuild(build_ext): ["cmake", ext.sourcedir] + cmake_args, cwd=self.build_temp ) subprocess.check_call( - ["cmake", "--build", ".", "--target", ext.name] + build_args, cwd=self.build_temp + ["cmake", "--verbose", "--build", ".", "--target", ext.name] + build_args, cwd=self.build_temp )