From 4ccd2501d08efed592930742aa4dceaf16088a9f Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Fri, 16 May 2025 05:58:59 +0200 Subject: [PATCH] Build on Mac (#93) --- .github/workflows/linux.yml | 1 - .github/workflows/mac.yml | 46 +++++++++++++++++++++++++++++++++++++ CMakeLists.txt | 4 ++++ README.md | 2 +- 4 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/mac.yml diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 83a602df..242ca537 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -25,7 +25,6 @@ jobs: cmake -S . -B build -GNinja \ -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} \ -DISLE_USE_DX5=OFF \ - -DISLE_D3DRM_FROM_WINE=OFF \ -DENABLE_CLANG_TIDY=ON \ -DISLE_WERROR=ON \ -Werror=dev diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml new file mode 100644 index 00000000..f8f97029 --- /dev/null +++ b/.github/workflows/mac.yml @@ -0,0 +1,46 @@ +name: macOS + +on: [push, pull_request] + +jobs: + build-macos: + runs-on: macos-latest + + strategy: + fail-fast: false + matrix: + build-type: [Release, Debug] + + steps: + - uses: actions/checkout@v4 + + - name: Install dependencies + run: | + brew update + brew install cmake ninja llvm + echo "CLANG_TIDY=$(brew --prefix llvm)/bin/clang-tidy" >> $GITHUB_ENV + + - name: Configure + run: | + cmake -S . -B build -GNinja \ + -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} \ + -DISLE_USE_DX5=OFF \ + -DENABLE_CLANG_TIDY=ON \ + -DCLANG_TIDY_BIN=$CLANG_TIDY \ + -DISLE_WERROR=ON \ + -Werror=dev + + - name: Build + run: cmake --build build -- -k0 + + - name: Make Artifact Archive + run: | + cd build + zip "isle-portable-macos-${{ matrix.build-type }}.zip" \ + config isle liblego1.dylib + + - name: Upload Build Artifacts + uses: actions/upload-artifact@v4 + with: + name: macos-artifacts-${{ matrix.build-type }} + path: build/isle-portable-macos-${{ matrix.build-type }}.zip diff --git a/CMakeLists.txt b/CMakeLists.txt index e0d77706..303e7619 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,6 +8,10 @@ include(CheckCXXSourceCompiles) include(CMakeDependentOption) include(CMakePushCheckState) +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_EXTENSIONS OFF) + if (NOT MINGW) set(NOT_MINGW ON) else() diff --git a/README.md b/README.md index 46f94c53..a19d52b8 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ Please note: this project is dedicated to achieving platform independence withou | - | - | | Windows | ✅ | | Linux | 🚧 | -| macOS | ❌ | +| macOS | 🚧 | ### Library substitutions