Skip to content

Commit

Permalink
- set CMAKE_GENERATOR env var to ensure Ninja is used on all platfo…
Browse files Browse the repository at this point in the history
…rms in CI

  - note: setting this in the scikit-build-core cmake args is not sufficient
  - scikit-build-core uses the default cmake generator on windows, which is modified by the CMAKE_GENERATOR env var
- fix config-subfolder logic to only apply when Visual Studio is used as generator
- ensure MSVC is the active default compiler on windows CI
  - scikit-build-core uses whatever the current default is (while scikit-build always uses MSVC)
  • Loading branch information
lkeegan committed Mar 21, 2024
1 parent bbdc755 commit b5c6200
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ on:

env:
USE_QEMU: ${{ github.event.inputs.use_qemu == 'true' }}
CMAKE_BUILD_PARALLEL_LEVEL: 4

jobs:
build-wheels:
Expand Down Expand Up @@ -71,6 +70,12 @@ jobs:
if: runner.os == 'Windows' && ((!matrix.use_qemu) || fromJSON(env.USE_QEMU))
run: git config --system core.longpaths true

- name: Set up msvc on Windows
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.arch }}

- name: Override LLVM version (${{ github.event.inputs.llvm_version }})
if: github.event.inputs.llvm_version
run: |
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ ExternalProject_add(build-clang-format
BUILD_COMMAND ${CMAKE_COMMAND} --build . --target clang-format --config Release
)
set(config-subfolder "")
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
if(CMAKE_GENERATOR MATCHES "Visual Studio")
set(config-subfolder "Release")
endif()
set(clang-format-executable ${CMAKE_BINARY_DIR}/llvm/${config-subfolder}/bin/clang-format${CMAKE_EXECUTABLE_SUFFIX})
Expand Down
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,13 @@ wheel.py-api = "py2.py3"
cmake.version = ">=3.16.0"
ninja.version = ">=1.10.0"
cmake.verbose = true
logging.level = "INFO"
logging.level = "DEBUG"

[tool.cibuildwheel]
# Super-verbose output for debugging purpose
build-verbosity = 3
# Set CMAKE_GENERATOR env var which is respected by scikit-build-core to use Ninja on all platforms
environment = "CMAKE_GENERATOR=Ninja"

# restrict to a single Python version as wheel does not depend on Python
build = "cp39-*"
Expand Down

0 comments on commit b5c6200

Please sign in to comment.