diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 5606f1342..475a5bc35 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -275,11 +275,12 @@ jobs: run: brew install freetype sdl2 libpng rtmidi qt@5 openal-soft ninja - name: Configure CMake run: >- - PATH=/usr/local/opt/qt@5/bin:$PATH cmake -G Ninja -S . -B build --preset ${{ matrix.build.preset }} - --toolchain cmake/flags-gcc-x86_64.cmake + --toolchain cmake/flags-gcc-x86_64.cmake --debug-find -D NEW_DYNAREC=${{ matrix.build.new-dynarec }} - -D CMAKE_FIND_ROOT_PATH=/usr/local/opt/qt@5 + -D Qt5_ROOT=$(brew --prefix qt@5) + -D Qt5LinguistTools_ROOT=$(brew --prefix qt@5) + -D OpenAL_ROOT=$(brew --prefix openal-soft) - name: Build run: cmake --build build - name: Generate package diff --git a/src/sound/CMakeLists.txt b/src/sound/CMakeLists.txt index 087f62cb1..c0aaa2790 100644 --- a/src/sound/CMakeLists.txt +++ b/src/sound/CMakeLists.txt @@ -31,10 +31,11 @@ if(OPENAL) if(TARGET OpenAL::OpenAL) target_link_libraries(86Box OpenAL::OpenAL) else() - include_directories(${OPENAL_INCLUDE_DIR}) target_link_libraries(86Box ${OPENAL_LIBRARY}) endif() + include_directories(${OPENAL_INCLUDE_DIR}) + target_sources(snd PRIVATE openal.c) else() if(WIN32) @@ -49,16 +50,16 @@ else() # Use FAudio, a reimplementation of XAudio2 pkg_check_modules(FAUDIO IMPORTED_TARGET FAudio) if(FAUDIO_FOUND) - include_directories(${FAUDIO_INCLUDE_DIRS}) target_link_libraries(86Box PkgConfig::FAUDIO) else() find_path(FAUDIO_INCLUDE_DIR NAMES "FAudio.h") find_library(FAUDIO_LIBRARY FAudio) - include_directories(${FAUDIO_INCLUDE_DIR}) target_link_libraries(86Box ${FAUDIO_LIBRARY}) endif() + include_directories(${FAUDIO_INCLUDE_DIRS}) + set_property(SOURCE xaudio2.c PROPERTY COMPILE_DEFINITIONS USE_FAUDIO) endif() endif()