Skip to content
Snippets Groups Projects
Commit 993afac7 authored by Lars Bilke's avatar Lars Bilke Committed by Dmitri Naumov
Browse files

[wheel,web] Use env var CMAKE_ARGS to override CMake preset for wheel.

parent fda342f7
No related branches found
No related tags found
No related merge requests found
...@@ -32,6 +32,7 @@ environment-pass = [ ...@@ -32,6 +32,7 @@ environment-pass = [
"CPM_SOURCE_CACHE", "CPM_SOURCE_CACHE",
"CCACHE_DIR", "CCACHE_DIR",
"CCACHE_MAXSIZE", "CCACHE_MAXSIZE",
"CMAKE_ARGS",
] ]
[tool.cibuildwheel.macos] [tool.cibuildwheel.macos]
......
...@@ -12,10 +12,6 @@ console_scripts = [] ...@@ -12,10 +12,6 @@ console_scripts = []
for b in binaries_list: for b in binaries_list:
console_scripts.append(f"{b}=ogs._internal.provide_ogs_cli_tools_via_wheel:{b}") console_scripts.append(f"{b}=ogs._internal.provide_ogs_cli_tools_via_wheel:{b}")
cmake_preset = "wheel"
if platform.system() == "Windows":
cmake_preset += "-win"
from pathlib import Path from pathlib import Path
this_directory = Path(__file__).parent this_directory = Path(__file__).parent
...@@ -33,7 +29,13 @@ if "SETUPTOOLS_SCM_LOCAL_SCHEME" in os.environ: ...@@ -33,7 +29,13 @@ if "SETUPTOOLS_SCM_LOCAL_SCHEME" in os.environ:
if os.environ["SETUPTOOLS_SCM_LOCAL_SCHEME"] in local_scheme_values: if os.environ["SETUPTOOLS_SCM_LOCAL_SCHEME"] in local_scheme_values:
scm_local_scheme = os.environ["SETUPTOOLS_SCM_LOCAL_SCHEME"] scm_local_scheme = os.environ["SETUPTOOLS_SCM_LOCAL_SCHEME"]
cmake_args = [f"--preset {cmake_preset}", "-B ."] if not "CMAKE_ARGS" in os.environ:
cmake_preset = "wheel"
if platform.system() == "Windows":
cmake_preset += "-win"
os.environ["CMAKE_ARGS"] = f"--preset {cmake_preset}"
cmake_args = ["-B ."]
if "SKBUILD_GENERATOR" in os.environ: if "SKBUILD_GENERATOR" in os.environ:
cmake_args.extend(["-G", os.environ["SKBUILD_GENERATOR"]]) cmake_args.extend(["-G", os.environ["SKBUILD_GENERATOR"]])
......
...@@ -13,7 +13,7 @@ weight = 1068 ...@@ -13,7 +13,7 @@ weight = 1068
Python wheel builds are driven by [scikit-build](https://scikit-build.readthedocs.io/en/latest/) which basically is a `setuptools`-wrapper for CMake-based projects. Python wheel builds are driven by [scikit-build](https://scikit-build.readthedocs.io/en/latest/) which basically is a `setuptools`-wrapper for CMake-based projects.
The entry point is `setup.py` in the root directory. It uses the `wheel` CMake preset (or `wheel-win` on Windows). The entry point is `setup.py` in the root directory. It uses the `wheel` CMake preset. The preset can be overridden and even other CMake options can be passed via the environment variable `CMAKE_ARGS`.
You can locally develop and test with the following setup: You can locally develop and test with the following setup:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment