Skip to content

Commit ba49d9a

Browse files
committed
warn users who are using env vars
1 parent 93f6112 commit ba49d9a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

setup.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,11 @@ def _is_truthy(value: Optional[str]) -> bool:
9595

9696
@staticmethod
9797
def _is_cmake_arg_enabled(var: str, default: bool) -> bool:
98+
if os.environ.get(var) is not None:
99+
raise RuntimeError(
100+
f"Python wheel building does not support setting '{var}' using environment variables. Use CMAKE_ARGS='-D{var}=ON' instead."
101+
)
102+
98103
value = _cmake_args_defines().get(var, None)
99104
if value is None:
100105
return default

0 commit comments

Comments
 (0)