Skip to content

Commit 07289e3

Browse files
committed
Add cross-compilation inputs
Signed-off-by: Cristian Le <git@lecris.dev>
1 parent 943c291 commit 07289e3

File tree

4 files changed

+15
-0
lines changed

4 files changed

+15
-0
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,9 @@ cmake.source-dir = "."
181181
# DEPRECATED in 0.10; use build.targets instead.
182182
cmake.targets = ""
183183

184+
# The CMAKE_TOOLCHAIN_FILE used for cross-compilation.
185+
cmake.toolchain-file = ""
186+
184187
# The versions of Ninja to allow. If Ninja is not present on the system or does
185188
# not pass this specifier, it will be downloaded via PyPI if possible. An empty
186189
# string will disable this check.

src/scikit_build_core/builder/builder.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,9 @@ def configure(
231231
python_include_dir = get_python_include_dir()
232232
numpy_include_dir = get_numpy_include_dir()
233233

234+
if self.settings.cmake.toolchain_file:
235+
cache_config["CMAKE_TOOLCHAIN_FILE"] = self.settings.cmake.toolchain_file
236+
234237
# Classic Find Python
235238
cache_config["PYTHON_EXECUTABLE"] = sys.executable
236239
cache_config["PYTHON_INCLUDE_DIR"] = python_include_dir

src/scikit_build_core/resources/scikit-build.schema.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,10 @@
102102
},
103103
"description": "DEPRECATED in 0.10; use build.targets instead.",
104104
"deprecated": true
105+
},
106+
"toolchain-file": {
107+
"type": "string",
108+
"description": "The CMAKE_TOOLCHAIN_FILE used for cross-compilation."
105109
}
106110
}
107111
},

src/scikit_build_core/settings/skbuild_model.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,11 @@ class CMakeSettings:
103103
DEPRECATED in 0.10; use build.targets instead.
104104
"""
105105

106+
toolchain_file: Optional[Path] = None
107+
"""
108+
The CMAKE_TOOLCHAIN_FILE used for cross-compilation.
109+
"""
110+
106111

107112
@dataclasses.dataclass
108113
class SearchSettings:

0 commit comments

Comments
 (0)