Skip to content

Commit 27d1d11

Browse files
authored
ci: fix the broken Python and WASM library builds (solvespace#1565)
* build: pin the Python build CMake version to 3.31.6 CMake 4.0.0 broke compatibility with versions earlier than 3.5, and the CI build has been failing because of it with error "Compatibility with CMake < 3.5 has been removed from CMake". This is caused by the CMake dependency version not being specified in `pyproject.toml`, which caused it to pull the latest version. * build: add components to CMake installation rules This allows the Python build to avoid failure when only the Python library is being built, as installation cannot find the targets that haven't been built. * ci: fix the WASM library build Somehow during the rebase I silently dropped the `--target` flag to the CMake build. Also, while changing it to `RelWithDebInfo`, I completely missed the fact that the variable was `DCMAKE_RELEASE_TYPE` instead of the correct `DCMAKE_BUILD_TYPE`.
1 parent e539385 commit 27d1d11

File tree

4 files changed

+16
-5
lines changed

4 files changed

+16
-5
lines changed

.github/scripts/build-wasmlib.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ source ../emsdk/emsdk_env.sh
1010
mkdir -p build-wasmlib
1111
cd build-wasmlib
1212
emcmake cmake .. \
13-
-DCMAKE_RELEASE_TYPE=RelWithDebInfo \
13+
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
1414
-DENABLE_GUI="OFF" \
1515
-DENABLE_CLI="OFF" \
1616
-DENABLE_TESTS="OFF" \
1717
-DENABLE_COVERAGE="OFF" \
1818
-DENABLE_OPENMP="OFF" \
1919
-DFORCE_VENDORED_Eigen3="ON" \
2020
-DENABLE_LTO="ON"
21-
cmake --build . -j$(nproc) slvs-wasm
21+
cmake --build . -j$(nproc) --target slvs-wasm

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[build-system]
2-
requires = ["scikit-build-core", "Cython", "cmake", "ninja"]
2+
requires = ["scikit-build-core", "Cython", "cmake==3.31.6", "ninja"]
33
build-backend = "scikit_build_core.build"
44

55
[project]
@@ -29,6 +29,7 @@ wheel.expand-macos-universal-tags = true
2929
cmake.verbose = true
3030
cmake.build-type = "RelWithDebInfo"
3131
build.targets = ["slvs-py"]
32+
install.components = ["python"]
3233
sdist.include = [
3334
".git/HEAD",
3435
".git/refs"

src/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,10 +405,12 @@ endif()
405405
if(NOT (WIN32 OR APPLE OR EMSCRIPTEN))
406406
if(ENABLE_GUI)
407407
install(TARGETS solvespace
408+
COMPONENT solvespace
408409
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
409410
endif()
410411
if(ENABLE_CLI)
411412
install(TARGETS solvespace-cli
413+
COMPONENT solvespace
412414
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
413415
endif()
414416
endif()

src/slvs/CMakeLists.txt

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,19 @@ if(ENABLE_PYTHON_LIB)
2626
)
2727
set_target_properties(slvs-py PROPERTIES LIBRARY_OUTPUT_NAME solvespace)
2828
if(SKBUILD)
29-
install(TARGETS slvs-py DESTINATION ${SKBUILD_PROJECT_NAME})
29+
install(TARGETS slvs-py
30+
DESTINATION ${SKBUILD_PROJECT_NAME}
31+
COMPONENT python
32+
)
3033
else()
31-
install(TARGETS slvs-py DESTINATION "slvs")
34+
install(TARGETS slvs-py
35+
DESTINATION "slvs"
36+
COMPONENT python
37+
)
3238
install(
3339
DIRECTORY ${CMAKE_SOURCE_DIR}/python/slvs/
3440
DESTINATION "slvs"
41+
COMPONENT python
3542
)
3643
endif()
3744
endif()
@@ -65,6 +72,7 @@ set_target_properties(slvs PROPERTIES
6572

6673
# if(NOT WIN32)
6774
install(TARGETS slvs
75+
COMPONENT slvs
6876
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
6977
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
7078
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})

0 commit comments

Comments
 (0)