diff --git a/.github/workflows/meson.yml b/.github/workflows/meson.yml index f75e12ccd..757b20058 100644 --- a/.github/workflows/meson.yml +++ b/.github/workflows/meson.yml @@ -147,7 +147,84 @@ jobs: path: CortexCommand.AppImage if-no-files-found: error - build-macos: + build-macos-arm: + runs-on: macos-latest + name: MacOS Build + + env: + MACOSX_DEPLOYMENT_TARGET: ${{inputs.macosx-deployment-target}} + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: "3.x" + - name: "Install Dependencies" + run: | + brew install ccache pkg-config sdl2 sdl2_image minizip lz4 flac luajit lua libpng tbb ninja meson dylibbundler + + - name: Set Version + if: ${{inputs.new_release_version}} + uses: ./.github/actions/set_version + with: + new_release_version: ${{inputs.new_release_version}} + github_token: ${{ secrets.GITHUB_TOKEN }} + + - name: ccache + uses: hendrikmuhs/ccache-action@v1 + with: + key: ${{ github.job }}-${{ matrix.os }} + + - name: Setup Meson + env: + LDFLAGS: "-static-libgcc -static-libstdc++" + CC: "gcc-14" + CXX: "g++-14" + run: | + meson setup --buildtype=${{inputs.build_type}} -Ddebug_type=${{inputs.debug_level}} -Db_lto=false build + + - name: Configure for App Bundle + if: ${{inputs.upload_artefacts}} + env: + LDFLAGS: "-static-libgcc -static-libstdc++" + run: | + meson configure \ + -Dinstall_data=false -Dinstall_runner=false -Dfmod_dir=Contents/Frameworks \ + --bindir=Contents/MacOS \ + --prefix="/" \ + -Ddylibbundler_args="-ns" \ + build + + - name: Build + env: + LDFLAGS: "-static-libgcc -static-libstdc++" + run: | + meson compile -C build + + - name: Create App Bundle + if: ${{inputs.upload_artefacts}} + run: | + meson install --destdir="/tmp/Cortex Command.app" -C build + + - name: Tar files + if: ${{inputs.upload_artefacts}} + run: | + cd /tmp/ + tar -cvf CortexCommand.tar "Cortex Command.app" + + - name: Move artefact + if: ${{inputs.upload_artefacts}} + run: cp /tmp/CortexCommand.tar . + + - name: Artifact Deploy + if: ${{inputs.upload_artefacts}} + uses: actions/upload-artifact@v4 + with: + name: CortexCommand (macOS) + path: | + CortexCommand.tar + if-no-files-found: error + + build-macos-x86: runs-on: ubuntu-latest name: MacOS Build diff --git a/README.md b/README.md index 2907ae5b5..e125a3270 100644 --- a/README.md +++ b/README.md @@ -123,7 +123,7 @@ If you want to change the buildtype afterwards, you can use `meson configure --b - `Xcode` or `Command Line Tools for Xcode` (if you need to, you can also generate an xcode project from meson using the `--backend=xcode` option on setup) **Homebrew (macOS):** -`brew install pkg-config sdl2 minizip lz4 flac luajit lua libpng tbb gcc@13 ninja meson dylibbundler` +`brew install pkg-config sdl2 sdl2_image minizip lz4 flac luajit lua libpng tbb gcc@13 ninja meson dylibbundler` **Arch Linux:** `sudo pacman -S sdl2 sdl2_image tbb flac luajit lua minizip lz4 libpng meson ninja base-devel` diff --git a/Source/Managers/WindowMan.cpp b/Source/Managers/WindowMan.cpp index 4e8bb256c..3cd02ae4f 100644 --- a/Source/Managers/WindowMan.cpp +++ b/Source/Managers/WindowMan.cpp @@ -101,8 +101,8 @@ void WindowMan::Initialize() { SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 3); - SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE); + SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1); + SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_COMPATIBILITY); CreatePrimaryWindow(); InitializeOpenGL(); CreateBackBufferTexture(); diff --git a/meson.build b/meson.build index b6e79b242..61e4230e6 100644 --- a/meson.build +++ b/meson.build @@ -199,10 +199,11 @@ if host_machine.system() in ['linux','darwin'] dependency('liblz4'), dependency('libpng'), dependency('tbb'), - dependency('gl') ] - if host_machine.system()=='darwin' - deps += dependency('appleframeworks', modules: ['Foundation']) + if host_machine.system() == 'linux' + deps += dependency('gl') + elif host_machine.system()=='darwin' + deps += dependency('appleframeworks', modules: ['Foundation', 'OpenGL']) endif bfd = compiler.find_library('bfd', required: false) if bfd.found()