Skip to content

Commit fd92882

Browse files
committed
Fix
1 parent 690c1b8 commit fd92882

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

setup.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from pathlib import Path
1111
import platform
1212
import re
13+
import shlex
1314
import shutil
1415
import subprocess
1516
import 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}"]

0 commit comments

Comments
 (0)