Skip to content

Commit 375513b

Browse files
committed
Fix with config-settings
1 parent ab86562 commit 375513b

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

apis/python/pyproject.toml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,10 +170,11 @@ before-build = [
170170
"bash -c 'if [ -d {project}/apis/python/vcpkg_triplets ]; then cp -f {project}/apis/python/vcpkg_triplets/*-release.cmake {project}/vcpkg/triplets/; fi'",
171171
]
172172

173+
# Pass vcpkg toolchain file as build config setting (cibuildwheel will pass this to build backend)
174+
config-settings = "cmake.define.CMAKE_TOOLCHAIN_FILE={project}/vcpkg/scripts/buildsystems/vcpkg.cmake"
175+
173176
# Set environment variables for the build
174-
# Note: {project} is expanded by cibuildwheel to the temp directory path
175-
# VCPKG_TARGET_TRIPLET is set via workflow environment for platform-specific builds
176-
environment = { VCPKG_ROOT="{project}/vcpkg", CMAKE_TOOLCHAIN_FILE="{project}/vcpkg/scripts/buildsystems/vcpkg.cmake", VCPKG_FORCE_SYSTEM_BINARIES="1" }
177+
environment = { VCPKG_ROOT="{project}/vcpkg", VCPKG_FORCE_SYSTEM_BINARIES="1" }
177178

178179
[tool.cibuildwheel.macos]
179180
# Bootstrap vcpkg (cibuildwheel runs in isolated environments)
@@ -183,9 +184,12 @@ before-build = [
183184
"bash -c 'if [ -d {project}/apis/python/vcpkg_triplets ]; then cp -f {project}/apis/python/vcpkg_triplets/*-release.cmake {project}/vcpkg/triplets/; fi'",
184185
]
185186

187+
# Pass vcpkg toolchain file as build config setting (cibuildwheel will pass this to build backend)
188+
config-settings = "cmake.define.CMAKE_TOOLCHAIN_FILE={project}/vcpkg/scripts/buildsystems/vcpkg.cmake"
189+
186190
# Set environment variables for the build
187191
# Platform-specific variables (VCPKG_TARGET_TRIPLET, CMAKE_OSX_ARCHITECTURES) set via workflow
188-
environment = { MACOSX_DEPLOYMENT_TARGET = "13.3", VCPKG_ROOT="{project}/vcpkg", CMAKE_TOOLCHAIN_FILE="{project}/vcpkg/scripts/buildsystems/vcpkg.cmake" }
192+
environment = { MACOSX_DEPLOYMENT_TARGET = "13.3", VCPKG_ROOT="{project}/vcpkg" }
189193

190194
# Note: Version is automatically derived from git tags via setuptools_scm
191195
# RELEASE-VERSION file can be generated as a fallback using _get_version.py

0 commit comments

Comments
 (0)