From 839ac750c2b2618353779bff9e07aa2e90dd9ac6 Mon Sep 17 00:00:00 2001 From: Luthaf Date: Wed, 24 May 2023 11:29:09 +0200 Subject: [PATCH] Use MVSC to build windows wheels --- .github/workflows/wheels.yml | 12 +++++++++++- CMakeLists.txt | 6 +++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 5fd429c..030d84b 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -12,7 +12,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-20.04, windows-2019, macOS-11] + os: [ubuntu-20.04, windows-2019, macos-11] steps: - uses: actions/checkout@v3 @@ -28,6 +28,9 @@ jobs: python -m pip install --upgrade pip python -m pip install cibuildwheel==2.11.2 + - name: setup MSVC command prompt + uses: ilammy/msvc-dev-cmd@v1 + - name: Build wheels run: python -m cibuildwheel --output-dir wheelhouse env: @@ -35,6 +38,13 @@ jobs: CIBW_SKIP: cp39-musllinux* *win32 CIBW_ARCHS_MACOS: x86_64 arm64 CIBW_BEFORE_BUILD: rm -rf build + CIBW_BUILD_VERBOSITY: 2 + + - name: Check that wheels install and load + run: | + pip install numpy + pip install --no-index --find-links=wheelhouse/ chemfiles + python -c "import chemfiles; chemfiles.Frame()" - uses: actions/upload-artifact@v3 with: diff --git a/CMakeLists.txt b/CMakeLists.txt index 754a53b..2308507 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -63,9 +63,9 @@ else() endif() if (MSVC) - set(CMAKE_CXX_FLAGS_RELEASE "/LTCG") - set(CMAKE_C_FLAGS_RELEASE "/LTCG") - set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "/LTCG") + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /LTCG") + set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /LTCG") + set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /LTCG") endif() message(STATUS "Using internal chemfiles from ${CMAKE_CURRENT_SOURCE_DIR}/lib")