File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change 1010from pathlib import Path
1111import platform
1212import re
13+ import shlex
1314import shutil
1415import subprocess
1516import sys
@@ -78,14 +79,25 @@ def build_extension(self, ext: CMakeExtension):
7879 "-DBUILD_PYTHON_BINDINGS=ON" ,
7980 ]
8081
82+ # Forward generic CMake args from environment (e.g. CI overrides).
83+ env_cmake_args = os .environ .get ("CMAKE_ARGS" , "" ).strip ()
84+ if env_cmake_args :
85+ cmake_args .extend (shlex .split (env_cmake_args ))
86+
8187 # Optional HPC release profile for source builds/wheels.
8288 if os .environ .get ("DSF_HPC_BUILD" , "" ).lower () in {
8389 "1" ,
8490 "on" ,
8591 "true" ,
8692 "yes" ,
8793 }:
88- cmake_args .extend (["-DDSF_HPC_RELEASE=ON" , "-DDSF_OPTIMIZE_ARCH=OFF" ])
94+ cmake_args .extend (
95+ [
96+ "-DDSF_HPC_RELEASE=ON" ,
97+ "-DDSF_OPTIMIZE_ARCH=OFF" ,
98+ "-DCMAKE_POSITION_INDEPENDENT_CODE=ON" ,
99+ ]
100+ )
89101
90102 if platform .system () == "Windows" :
91103 cmake_args += [f"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_{ cfg .upper ()} ={ extdir } " ]
You can’t perform that action at this time.
0 commit comments