Skip to content

Commit

Permalink
Use ninja build.
Browse files Browse the repository at this point in the history
  • Loading branch information
kevingurney committed Nov 21, 2023
1 parent 35f5a0b commit 778f154
Showing 1 changed file with 1 addition and 47 deletions.
48 changes: 1 addition & 47 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,52 +1,6 @@
name: "libmexclass"
on: [push]
jobs:
linux:
runs-on: ubuntu-latest
env:
LIBMEXCLASS_INSTALL_PREFIX: "/home/runner/work/install"
SYSTEM_LIBSTDCPP_PATH: "/usr/lib/x86_64-linux-gnu/libstdc++.so.6"
steps:
- name: Download libmexclass source code
uses: actions/checkout@v3
- name: Install MATLAB
uses: matlab-actions/setup-matlab@v1
with:
release: R2023b
- name: Build Example
run: |
cd example
cmake -S . -B build -D CMAKE_INSTALL_PREFIX=${{ env.LIBMEXCLASS_INSTALL_PREFIX }} -D LIBMEXCLASS_FETCH_CONTENT_GIT_TAG=${{ github.sha }}
cmake --build build --config Release --target install
- name: Run Example
uses: matlab-actions/run-command@v1
env:
# The version of libstdc++ that is bundled with MATLAB is used when building MEX files.
# This version of libstdc++ is incompatible with the system version of libstdc++.
# As a workaround, set LD_PRELOAD to use the system version of libstdc++ with MATLAB.
LD_PRELOAD: ${{ env.SYSTEM_LIBSTDCPP_PATH }}
with:
command: addpath(fullfile("${{ env.LIBMEXCLASS_INSTALL_PREFIX }}")), addpath(fullfile("example", "matlab")), c = example.Car("A", "B", "C")
mac:
runs-on: macos-latest
env:
LIBMEXCLASS_INSTALL_PREFIX: "~/install"
steps:
- name: Download libmexclass source code
uses: actions/checkout@v3
- name: Install MATLAB
uses: matlab-actions/setup-matlab@v1
with:
release: R2023b
- name: Build Example
run: |
cd example
cmake -S . -B build -D CMAKE_INSTALL_PREFIX=${{ env.LIBMEXCLASS_INSTALL_PREFIX }} -D LIBMEXCLASS_FETCH_CONTENT_GIT_TAG=${{ github.sha }}
cmake --build build --config Release --target install
- name: Run Example
uses: matlab-actions/run-command@v1
with:
command: addpath(fullfile("${{ env.LIBMEXCLASS_INSTALL_PREFIX }}")), addpath(fullfile("example", "matlab")), c = example.Car("A", "B", "C")
windows:
runs-on: windows-latest
env:
Expand All @@ -64,7 +18,7 @@ jobs:
run: |
cd example
echo "LIBMEXCLASS_INSTALL_PREFIX= ${{ env.LIBMEXCLASS_GIT_TAG }}"
cmake -S . -B build -D CMAKE_INSTALL_PREFIX=${{ env.LIBMEXCLASS_INSTALL_PREFIX }} -D LIBMEXCLASS_FETCH_CONTENT_GIT_TAG=${{ github.sha }}
cmake -S . -B build -G Ninja -D CMAKE_INSTALL_PREFIX=${{ env.LIBMEXCLASS_INSTALL_PREFIX }} -D LIBMEXCLASS_FETCH_CONTENT_GIT_TAG=${{ github.sha }}
cmake --build build --config Release --target install
- name: Run Example
uses: matlab-actions/run-command@v1
Expand Down

0 comments on commit 778f154

Please sign in to comment.