diff --git a/.github/workflows/linux.yml b/.github/workflows/build.yml similarity index 67% rename from .github/workflows/linux.yml rename to .github/workflows/build.yml index c0d8a6d..bdc7dcc 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/build.yml @@ -1,17 +1,23 @@ -name: Linux build +name: Build on: [push, pull_request] jobs: - linux-build: - name: Linux build - runs-on: ubuntu-latest + build: + name: Compile on ${{ matrix.os }} + runs-on: ${{ matrix.os }} strategy: fail-fast: false + matrix: + os: [macos-latest, windows-latest, ubuntu-latest] steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 + + - name: Setup MSVC environment + uses: ilammy/msvc-dev-cmd@v1 + if: matrix.os == 'windows-latest' - name: Setup Conda uses: conda-incubator/setup-miniconda@v2 @@ -31,7 +37,10 @@ jobs: shell: bash -l {0} working-directory: ./build run: | - LDFLAGS="$LDFLAGS -Wl,-rpath-link,$CONDA_PREFIX/lib -pthread -lpthread" \ + if [ "$RUNNER_OS" == "Windows" ]; then + export CC=cl.exe + export CXX=cl.exe + fi cmake -G Ninja \ -DCMAKE_INSTALL_PREFIX=${CONDA_PREFIX} \ .. diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml deleted file mode 100644 index e46c822..0000000 --- a/.github/workflows/macos.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: MacOS build - -on: [push, pull_request] - -jobs: - macos-build: - name: MacOS build - runs-on: macos-latest - strategy: - fail-fast: false - - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Setup Conda - uses: conda-incubator/setup-miniconda@v2 - with: - channels: conda-forge - auto-update-conda: true - - - name: Install dependencies - shell: bash -l {0} - run: | - mkdir build - conda update -n base -c defaults conda - conda install -c conda-forge cmake ninja -y - conda install -c conda-forge --yes --quiet pdal -y - - - name: Run cmake - shell: bash -l {0} - working-directory: ./build - run: | - cmake -G Ninja \ - -DCMAKE_FIND_FRAMEWORK="NEVER" \ - -DCMAKE_INSTALL_PREFIX=${CONDA_PREFIX} \ - .. - - - name: Build pdal_wrench - shell: bash -l {0} - working-directory: ./build - run: | - ninja - ninja install diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml deleted file mode 100644 index a3ec622..0000000 --- a/.github/workflows/windows.yml +++ /dev/null @@ -1,49 +0,0 @@ -name: Windows build - -on: [push, pull_request] - -jobs: - windows-build: - name: MSVC build - runs-on: windows-latest - strategy: - fail-fast: false - - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Setup MSVC environment - uses: ilammy/msvc-dev-cmd@v1 - - - name: Setup Conda - uses: conda-incubator/setup-miniconda@v2 - with: - channels: conda-forge - auto-update-conda: true - - - name: Install dependencies - shell: bash -l {0} - run: | - mkdir build - conda update -n base -c defaults conda - conda install -c conda-forge cmake ninja -y - conda install -c conda-forge --yes --quiet pdal -y - - - name: Run cmake - shell: bash -l {0} - working-directory: ./build - run: | - export CC=cl.exe - export CXX=cl.exe - cmake -G "Ninja" \ - -DCMAKE_INSTALL_PREFIX="$CONDA_PREFIX" \ - -DCMAKE_PREFIX_PATH="$CONDA_PREFIX/Library" \ - .. - - - name: Build pdal_wrench - shell: bash -l {0} - working-directory: ./build - run: | - ninja -v - ninja install diff --git a/environment.yml b/environment.yml new file mode 100644 index 0000000..fac9fb6 --- /dev/null +++ b/environment.yml @@ -0,0 +1,11 @@ +name: wrench +channels: + - conda-forge +dependencies: + - conda + - mamba + - compilers + - ninja + - cmake + - pdal +