Skip to content
This repository was archived by the owner on Oct 7, 2024. It is now read-only.

Commit 58d5067

Browse files
committed
CMakeLists.txt: fix find_package(Python ...)
- drop version string hack (no longer needed since switching to cibuildwheel) - drop Interpreter component (was never needed) - use more specific Development.Module component - add REQUIRED option - drop version requirement (scikit-build provides all needed info) Requires recent scikit-build fix to properly find the library. scikit-build/scikit-build#913
1 parent d70e9bb commit 58d5067

2 files changed

Lines changed: 2 additions & 5 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,7 @@ else()
2626
add_compile_options(-Werror)
2727
endif()
2828

29-
# strip suffix to allow support for prerelease version
30-
string(REGEX MATCH "^[0-9]\\.[0-9]+(\\.[0-9]+)?" PYTHON_BASE_VERSION ${PYTHON_VERSION_STRING})
31-
32-
find_package (Python3 ${PYTHON_BASE_VERSION} EXACT COMPONENTS Interpreter Development)
29+
find_package(Python3 REQUIRED COMPONENTS Development.Module)
3330

3431
Python3_add_library (_winrt MODULE ${sources})
3532
set_target_properties(_winrt PROPERTIES LIBRARY_OUTPUT_NAME_DEBUG _winrt_d)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[build-system]
2-
requires = ["setuptools", "wheel", "scikit-build", "cmake", "ninja"]
2+
requires = ["setuptools", "wheel", "scikit-build @ https://github.com/scikit-build/scikit-build/archive/12ec865419765661bc70a26e9c21464d515307d2.zip", "cmake", "ninja"]
33
build-backend = "setuptools.build_meta"
44

55
[tool.cibuildwheel]

0 commit comments

Comments
 (0)