add USE_CUDA env in python_build
This commit is contained in:
@@ -26,12 +26,19 @@ def build(setup_kwargs):
|
||||
print(f"Project root: {project_root}")
|
||||
print(f"Target binary dir: {package_dir}")
|
||||
|
||||
# Determine if CUDA should be enabled
|
||||
use_cuda = os.environ.get("USE_CUDA", "OFF").upper()
|
||||
if use_cuda in ["ON", "1", "TRUE", "YES"]:
|
||||
use_cuda = "ON"
|
||||
else:
|
||||
use_cuda = "OFF"
|
||||
|
||||
# CMake configuration
|
||||
cmake_args = [
|
||||
f"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY={package_dir}",
|
||||
f"-DPYTHON_EXECUTABLE={sys.executable}",
|
||||
"-DCMAKE_BUILD_TYPE=Release",
|
||||
"-DUSE_CUDA=OFF",
|
||||
f"-DUSE_CUDA={use_cuda}",
|
||||
"-G", "Unix Makefiles",
|
||||
]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user