Skip to content

Commit

Permalink
fix: Fix CMake issues with MacOS
Browse files Browse the repository at this point in the history
  • Loading branch information
ThePythonator committed Jul 28, 2024
1 parent d54275d commit f993eab
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 21 deletions.
24 changes: 11 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
name: Linux
release-suffix: LIN64
cmake-args: #-DSDL2_IMAGE_DIR=$GITHUB_WORKSPACE/main/SDL2
apt-packages: libsdl2-dev libsdl2-image-dev python3-setuptools
apt-packages: #libxmp-dev
can-fail: false

- os: ubuntu-20.04
Expand All @@ -43,7 +43,7 @@ jobs:
name: macOS
release-suffix: MACOS
cmake-args: #-DSDL2_IMAGE_DIR=$GITHUB_WORKSPACE/main/SDL2
brew-packages: sdl2 sdl2_image
brew-packages: #libxmp
can-fail: true

- os: windows-latest
Expand Down Expand Up @@ -71,21 +71,19 @@ jobs:
if: runner.os == 'Linux'
run: |
sudo apt update && sudo apt install ${{matrix.apt-packages}}
pip3 install 32blit
# MacOS dependencies
- name: Install macOS deps
if: runner.os == 'macOS'
run: |
brew install ${{matrix.brew-packages}}
python3 -m pip install 32blit
#- name: Install macOS deps
# if: runner.os == 'macOS'
# run: |
# brew install ${{matrix.brew-packages}}

# Windows dependencies
- name: Install Windows deps
if: runner.os == 'Windows'
shell: bash
run: |
python -m pip install 32blit
#- name: Install Windows deps
# if: runner.os == 'Windows'
# shell: bash
# run: |
# python -m pip install 32blit

# Emscripten SDK setup
- name: Setup Emscripten cache
Expand Down
12 changes: 4 additions & 8 deletions fetch/get_sdl2.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -42,21 +42,17 @@ if(NOT TARGET SDL2::image)
GIT_TAG release-2.8.2
)
add_subdirectory(${sdl2_image_SOURCE_DIR} SDL2_image EXCLUDE_FROM_ALL)
#set_property(TARGET jpeg PROPERTY POSITION_INDEPENDENT_CODE ON) # build fix
endif()

if(NOT TARGET SDL2::mixer)
# Not sure what I'm doing here
set(SUPPORT_MP3_MPG123 ON)
#set(SUPPORT_OGG ON)
set(SUPPORT_OGG ON CACHE BOOL "")
set(SDL2MIXER_OPUS OFF CACHE BOOL "" FORCE)
set(SDL2MIXER_MOD OFF CACHE BOOL "" FORCE)
set(SDL2MIXER_MIDI OFF CACHE BOOL "" FORCE)
set(SDL2MIXER_WAVPACK OFF CACHE BOOL "" FORCE)

FetchContent_Populate(SDL2_mixer
GIT_REPOSITORY https://github.com/libsdl-org/SDL_mixer
GIT_TAG release-2.8.0
)
#add_definitions(-DMUSIC_MP3 -DMUSIC_OGG) # VS compile errors if no music formats?? //-DMUSIC_WAV
add_subdirectory(${sdl2_mixer_SOURCE_DIR} SDL2_mixer EXCLUDE_FROM_ALL)
#set_property(TARGET vorbisidec PROPERTY POSITION_INDEPENDENT_CODE ON) # build fix
# ogg too?
endif()

0 comments on commit f993eab

Please sign in to comment.