Skip to content

Improve CMake

Improve CMake #1619

name: Build Coal for Windows (v142) via Conda
on: [push,pull_request]
jobs:
build:
runs-on: ${{ matrix.os }}
env:
CCACHE_BASEDIR: "${GITHUB_WORKSPACE}"
CCACHE_DIR: "${GITHUB_WORKSPACE}/.ccache"
CCACHE_COMPRESS: true
CCACHE_COMPRESSLEVEL: 6
strategy:
fail-fast: false
matrix:
name: [windows-latest]
include:
- name: windows-latest
os: windows-2019
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/cache@v3
with:
path: .ccache
key: ccache-windows-conda-vs-${{ matrix.os }}-${{ matrix.compiler }}-${{ github.sha }}
restore-keys: ccache-windows-conda-vs-${{ matrix.os }}-${{ matrix.compiler }}-
- uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: coal
auto-update-conda: true
environment-file: .github/workflows/conda/environment_windows.yml
python-version: "3.10"
auto-activate-base: false
- name: Build Coal
shell: cmd /C CALL {0}
run: |
call "%programfiles(x86)%\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" amd64
:: Create build
mkdir build
pushd build
:: Configure
cmake ^
-G "Ninja" ^
-DCMAKE_INSTALL_PREFIX=%CONDA_PREFIX%\Library ^
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache ^
-DCMAKE_BUILD_TYPE=Release ^
-DGENERATE_PYTHON_STUBS=ON ^
-DPYTHON_SITELIB=%CONDA_PREFIX%\Lib\site-packages ^
-DPYTHON_EXECUTABLE=%CONDA_PREFIX%\python.exe ^
-DCOAL_HAS_QHULL=ON ^
-DBUILD_PYTHON_INTERFACE=ON ^
..
if errorlevel 1 exit 1
:: Build and Install
cmake --build . --config Release --target all
if errorlevel 1 exit 1
:: Testing
ctest --output-on-failure -C Release
if errorlevel 1 exit 1
:: Test Python import
python -c "import coal"
if errorlevel 1 exit 1
check:
if: always()
name: check-windows-conda-v142
needs:
- build
runs-on: Ubuntu-latest
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}