diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index bc34bf082c..8a1a7dea33 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -4,262 +4,282 @@ on: branches: [ master ] pull_request: branches: [ master ] +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true +permissions: + contents: read env: # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) BUILD_TYPE: Release jobs: - build: + build-linux: # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac. # You can convert this to a matrix build if you need cross-platform coverage. # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix runs-on: ubuntu-latest + timeout-minutes: 20 steps: - - uses: actions/checkout@v3 - - name: install_dependencies + - uses: actions/checkout@v4 + with: + submodules: recursive + - name: Cache ccache + uses: actions/cache@v4 + with: + path: ${{ github.workspace }}/.ccache/linux + key: linux-ccache-${{ runner.os }}-${{ env.BUILD_TYPE }}-${{ hashFiles('**/CMakeLists.txt') }} + restore-keys: linux-ccache-${{ runner.os }}-${{ env.BUILD_TYPE }}- + - name: Install dependencies run: | sudo apt-get update -y -qq - sudo apt-get install libsdl2-dev - - name: init_submodules - run: git submodule update --init --recursive + sudo apt-get install -y -qq libsdl2-dev ninja-build ccache - name: Configure CMake # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type - run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DDPPC_68K_DEBUGGER=ON + env: + CCACHE_DIR: ${{ github.workspace }}/.ccache/linux + CCACHE_BASEDIR: ${{ github.workspace }} + run: cmake -S . -B ${{github.workspace}}/build -GNinja -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DDPPC_68K_DEBUGGER=ON -DDPPC_BUILD_PPC_TESTS=ON -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache - name: Build # Build your program with the given configuration - run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} - - name: Upload artifact - uses: actions/upload-artifact@v4 - with: - name: DingusPPC-LINUX - path: ${{github.workspace}}/build/bin + run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --parallel + - name: ccache stats + run: ccache --show-stats || true - name: Test working-directory: ${{github.workspace}}/build # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail - run: ctest -C ${{env.BUILD_TYPE}} - build-windows: - runs-on: windows-latest - strategy: - matrix: - cache-name: [msys64-cache] - env: - MSYSTEM: MINGW64 - FF_SCRIPT_SECTIONS: '0' - CONFIGURE_ARGS: '--target-list=x86_64-softmmu --without-default-devices -Ddebug=false -Doptimization=0' - TEST_ARGS: '--no-suite qtest' - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - name: Set up MSYS2 - run: | - Write-Output "Acquiring msys2.exe installer at $(Get-Date -Format u)" - If ( !(Test-Path -Path msys64\var\cache ) ) { - mkdir msys64\var\cache - } - Invoke-WebRequest "https://repo.msys2.org/distrib/msys2-x86_64-latest.sfx.exe.sig" -outfile "msys2.exe.sig" - if ( Test-Path -Path msys64\var\cache\msys2.exe.sig ) { - Write-Output "Cached installer sig" ; - if ( ((Get-FileHash msys2.exe.sig).Hash -ne (Get-FileHash msys64\var\cache\msys2.exe.sig).Hash) ) { - Write-Output "Mis-matched installer sig, new installer download required" ; - Remove-Item -Path msys64\var\cache\msys2.exe.sig ; - if ( Test-Path -Path msys64\var\cache\msys2.exe ) { - Remove-Item -Path msys64\var\cache\msys2.exe - } - } else { - Write-Output "Matched installer sig, cached installer still valid" - } - } else { - Write-Output "No cached installer sig, new installer download required" ; - if ( Test-Path -Path msys64\var\cache\msys2.exe ) { - Remove-Item -Path msys64\var\cache\msys2.exe - } - } - if ( !(Test-Path -Path msys64\var\cache\msys2.exe ) ) { - Write-Output "Fetching latest installer" ; - Invoke-WebRequest "https://repo.msys2.org/distrib/msys2-x86_64-latest.sfx.exe" -outfile "msys64\var\cache\msys2.exe" ; - Copy-Item -Path msys2.exe.sig -Destination msys64\var\cache\msys2.exe.sig - } else { - Write-Output "Using cached installer" - } - Write-Output "Invoking msys2.exe installer at $(Get-Date -Format u)" - msys64\var\cache\msys2.exe -y - ((Get-Content -path .\msys64\etc\post-install\07-pacman-key.post -Raw) -replace '--refresh-keys', '--version') | Set-Content -Path .\msys64\etc\post-install\07-pacman-key.post - .\msys64\usr\bin\bash -lc "sed -i 's/^CheckSpace/#CheckSpace/g' /etc/pacman.conf" - .\msys64\usr\bin\bash -lc 'pacman --noconfirm -Syuu' # Core update - .\msys64\usr\bin\bash -lc 'pacman --noconfirm -Syuu' # Normal update - taskkill /F /FI "MODULES eq msys-2.0.dll" - - name: Install dependencies - run: | - Write-Output "Installing mingw packages at $(Get-Date -Format u)" - .\msys64\usr\bin\bash -lc 'pacman -Sy --noconfirm --needed \ - bison \ - diffutils \ - flex \ - tar \ - doxygen \ - cmake \ - wget \ - git \ - grep \ - make \ - rsync \ - ninja \ - glib2-devel \ - patch \ - sed \ - mingw-w64-x86_64-cmake \ - mingw-w64-x86_64-binutils \ - mingw-w64-x86_64-doxygen \ - mingw-w64-x86_64-capstone \ - mingw-w64-x86_64-ccache \ - mingw-w64-x86_64-curl \ - mingw-w64-x86_64-cyrus-sasl \ - mingw-w64-x86_64-dtc \ - mingw-w64-x86_64-gcc \ - mingw-w64-x86_64-glib2 \ - mingw-w64-x86_64-gnutls \ - mingw-w64-x86_64-gtk3 \ - mingw-w64-x86_64-libgcrypt \ - mingw-w64-x86_64-libjpeg-turbo \ - mingw-w64-x86_64-libnfs \ - mingw-w64-x86_64-libpng \ - mingw-w64-x86_64-libssh \ - mingw-w64-x86_64-libtasn1 \ - mingw-w64-x86_64-libusb \ - mingw-w64-x86_64-lzo2 \ - mingw-w64-x86_64-libslirp \ - mingw-w64-x86_64-nettle \ - mingw-w64-x86_64-clang \ - mingw-w64-x86_64-ninja \ - mingw-w64-x86_64-pixman \ - mingw-w64-x86_64-pkgconf \ - mingw-w64-x86_64-python \ - mingw-w64-x86_64-SDL2 \ - mingw-w64-x86_64-SDL2_image \ - mingw-w64-x86_64-snappy \ - mingw-w64-x86_64-spice \ - mingw-w64-x86_64-usbredir \ - mingw-w64-x86_64-zstd \ - mingw-w64-x86_64-make' - - name: init_submodules - run: git submodule update --init --recursive - - name: Build - run: | - Write-Output "Running build at $(Get-Date -Format u)" - $env:CHERE_INVOKING = 'yes' # Preserve the current working directory - $env:MSYS = 'winsymlinks:native' # Enable native Windows symlink - $env:CCACHE_BASEDIR = "$env:CI_PROJECT_DIR" - $env:CCACHE_DIR = "$env:CCACHE_BASEDIR/ccache" - $env:CCACHE_MAXSIZE = "500M" - $env:CCACHE_DEPEND = 1 # cache misses are too expensive with preprocessor mode - $env:CC = "ccache gcc" - mkdir build - cd build - D:\a\dingusppc\dingusppc\msys64\usr\bin\bash -lc "ccache --zero-stats" - D:\a\dingusppc\dingusppc\msys64\usr\bin\bash -lc "cmake -DCMAKE_BUILD_TYPE=Release -DPPC_BUILD_PPC_TESTS=True .. && ninja" - D:\a\dingusppc\dingusppc\msys64\usr\bin\bash -lc "ccache --show-stats" - Write-Output "Finished build at $(Get-Date -Format u)" - - - vsbuild-CLANG: - runs-on: windows-latest - steps: - - uses: actions/checkout@v3 - - name: Setup msbuild - if: inputs.configuration != 'CMake' - uses: microsoft/setup-msbuild@v1 - - name: Setup VCPKG - run: | - vcpkg integrate install - vcpkg install pthread:x64-windows - vcpkg install pthreads:x64-windows - vcpkg install pthread-stubs:x64-windows - vcpkg install pthreadpool:x64-windows - vcpkg install - - name: init_submodules - run: git submodule update --init --recursive - - name: Build - shell: cmd - run: | - mkdir build - cd build - call "%ProgramFiles%\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" - cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl -DPPC_BUILD_PPC_TESTS=True -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows .. - nmake + run: ctest -C ${{env.BUILD_TYPE}} --output-on-failure + - name: Upload logs on failure + if: failure() + uses: actions/upload-artifact@v4 + with: + name: logs-${{ github.job }} + path: | + ${{ github.workspace }}/build/Testing/Temporary/LastTest.log + ${{ github.workspace }}/build/CMakeFiles/CMakeOutput.log + ${{ github.workspace }}/build/CMakeFiles/CMakeError.log + if-no-files-found: ignore + retention-days: ${{ github.event_name == 'pull_request' && 7 || 30 }} - name: Upload artifact if: always() uses: actions/upload-artifact@v4 with: - name: DingusPPC-CLANG + name: DingusPPC-LINUX path: ${{github.workspace}}/build/bin + retention-days: ${{ github.event_name == 'pull_request' && 7 || 30 }} - - - vsbuild-MSVC: - runs-on: windows-latest + build-macos: + timeout-minutes: 30 + strategy: + fail-fast: false + matrix: + include: + - runner: macos-latest + arch: arm64 + brew_prefix: /opt/homebrew + - runner: macos-15-intel + arch: x86_64 + brew_prefix: /usr/local + runs-on: ${{ matrix.runner }} steps: - - uses: actions/checkout@v3 - - name: Setup msbuild - if: inputs.configuration != 'CMake' - uses: microsoft/setup-msbuild@v1 - - name: Setup VCPKG + - uses: actions/checkout@v4 + with: + submodules: recursive + - name: Cache ccache + uses: actions/cache@v4 + with: + path: ${{ github.workspace }}/.ccache/${{ matrix.arch }} + key: macos-${{ matrix.runner }}-${{ matrix.arch }}-ccache-${{ env.BUILD_TYPE }}-${{ hashFiles('**/CMakeLists.txt') }} + restore-keys: macos-${{ matrix.runner }}-${{ matrix.arch }}-ccache-${{ env.BUILD_TYPE }}- + - name: Install dependencies run: | - vcpkg integrate install - vcpkg install pthread:x64-windows - vcpkg install pthreads:x64-windows - vcpkg install pthread-stubs:x64-windows - vcpkg install pthreadpool:x64-windows - vcpkg install - - name: init_submodules - run: git submodule update --init --recursive - - name: Build - shell: cmd + export HOMEBREW_NO_AUTO_UPDATE=1 + export HOMEBREW_NO_INSTALL_CLEANUP=1 + brew install sdl2 ccache ninja + - name: Configure CMake + env: + CCACHE_DIR: ${{ github.workspace }}/.ccache/${{ matrix.arch }} + CCACHE_BASEDIR: ${{ github.workspace }} run: | - mkdir build - cd build - call "%ProgramFiles%\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" - cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DPPC_BUILD_PPC_TESTS=True -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows .. - nmake + export PATH="${{ matrix.brew_prefix }}/opt/ccache/libexec:$PATH" + cmake -S . -B ${{github.workspace}}/build -GNinja -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DDPPC_68K_DEBUGGER=ON -DDPPC_BUILD_PPC_TESTS=ON -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_OSX_ARCHITECTURES=${{ matrix.arch }} + - name: Build + run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --parallel + - name: ccache stats + run: ccache --show-stats || true + - name: Test + working-directory: ${{github.workspace}}/build + run: ctest -C ${{env.BUILD_TYPE}} --output-on-failure + - name: Upload logs on failure + if: failure() + uses: actions/upload-artifact@v4 + with: + name: logs-${{ github.job }}-${{ matrix.arch }} + path: | + ${{ github.workspace }}/build/Testing/Temporary/LastTest.log + ${{ github.workspace }}/build/CMakeFiles/CMakeOutput.log + ${{ github.workspace }}/build/CMakeFiles/CMakeError.log + if-no-files-found: ignore + retention-days: ${{ github.event_name == 'pull_request' && 7 || 30 }} - name: Upload artifact if: always() uses: actions/upload-artifact@v4 with: - name: DingusPPC-MSVC + name: DingusPPC-macOS-${{ matrix.arch }} path: ${{github.workspace}}/build/bin + retention-days: ${{ github.event_name == 'pull_request' && 7 || 30 }} + build-windows-msys2: + runs-on: windows-latest + timeout-minutes: 45 + env: + MSYSTEM: MINGW64 + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + submodules: recursive + - name: Cache ccache + uses: actions/cache@v4 + with: + path: ${{ github.workspace }}/.ccache/msys + key: windows-msys-ccache-${{ env.BUILD_TYPE }}-${{ hashFiles('**/CMakeLists.txt') }} + restore-keys: windows-msys-ccache-${{ env.BUILD_TYPE }}- + - name: Setup MSYS2 + uses: msys2/setup-msys2@v2 + with: + msystem: MINGW64 + update: true + install: >- + cmake + ninja + git + mingw-w64-x86_64-cmake + mingw-w64-x86_64-gcc + mingw-w64-x86_64-binutils + mingw-w64-x86_64-ninja + mingw-w64-x86_64-pkgconf + mingw-w64-x86_64-SDL2 + mingw-w64-x86_64-ccache + - name: Build + shell: msys2 {0} + run: | + echo "Running build at $(date -u +'%Y-%m-%dT%H:%M:%SZ')" + export CHERE_INVOKING=yes + export MSYS=winsymlinks:native + export CCACHE_BASEDIR="${GITHUB_WORKSPACE}" + export CCACHE_DIR="${GITHUB_WORKSPACE}/.ccache/msys" + export CCACHE_DEPEND=1 + ccache --zero-stats || true + cmake -S . -B build -GNinja -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} -DDPPC_68K_DEBUGGER=ON -DDPPC_BUILD_PPC_TESTS=ON -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache + cmake --build build --config ${{ env.BUILD_TYPE }} --parallel + ccache --show-stats || true + echo "Finished build at $(date -u +'%Y-%m-%dT%H:%M:%SZ')" + - name: Test + shell: msys2 {0} + run: | + cd build + ctest --output-on-failure --parallel + - name: Upload logs on failure + if: failure() + uses: actions/upload-artifact@v4 + with: + name: logs-${{ github.job }} + path: | + ${{ github.workspace }}/build/Testing/Temporary/LastTest.log + ${{ github.workspace }}/build/CMakeFiles/CMakeOutput.log + ${{ github.workspace }}/build/CMakeFiles/CMakeError.log + if-no-files-found: ignore + retention-days: ${{ github.event_name == 'pull_request' && 7 || 30 }} + - name: Upload artifact + if: always() + uses: actions/upload-artifact@v4 + with: + name: DingusPPC-MSYS + path: ${{github.workspace}}/build/bin + retention-days: ${{ github.event_name == 'pull_request' && 7 || 30 }} - - - - vsbuild-MSVC-MSBUILD: + build-windows-vsbuild: runs-on: windows-latest + timeout-minutes: 45 + env: + VCPKG_FEATURE_FLAGS: binarycaching + strategy: + fail-fast: false + matrix: + include: + - name: clang + generator: Ninja + cmake_args: -DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl + ccache_args: -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache + upload_suffix: CLANG + - name: msvc + generator: Ninja + cmake_args: "" + ccache_args: -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache + upload_suffix: MSVC + - name: msbuild + generator: "Visual Studio 17 2022" + cmake_args: "" + ccache_args: "" + upload_suffix: MSBUILD steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + with: + submodules: recursive - name: Setup msbuild - if: inputs.configuration != 'CMake' uses: microsoft/setup-msbuild@v1 - - name: Setup VCPKG - run: | - vcpkg integrate install - vcpkg install pthread:x64-windows - vcpkg install pthreads:x64-windows - vcpkg install pthread-stubs:x64-windows - vcpkg install pthreadpool:x64-windows - vcpkg install - - name: init_submodules - run: git submodule update --init --recursive - - name: Build + - name: Install vcpkg packages + shell: cmd + run: '"%VCPKG_INSTALLATION_ROOT%\vcpkg.exe" install --triplet x64-windows' + - name: Install Ninja + if: matrix.generator == 'Ninja' + run: choco install ninja -y + - name: Cache ccache + if: matrix.generator == 'Ninja' + uses: actions/cache@v4 + with: + path: ${{ github.workspace }}/.ccache/vsbuild-${{ matrix.name }} + key: vsbuild-${{ matrix.name }}-ccache-${{ env.BUILD_TYPE }}-${{ hashFiles('**/CMakeLists.txt') }} + restore-keys: vsbuild-${{ matrix.name }}-ccache-${{ env.BUILD_TYPE }}- + - name: Install ccache + if: matrix.generator == 'Ninja' + run: choco install ccache -y + - name: Configure & Build shell: cmd + env: + CCACHE_DIR: ${{ github.workspace }}/.ccache/vsbuild-${{ matrix.name }} + CCACHE_BASEDIR: ${{ github.workspace }} run: | mkdir build - cd build call "%ProgramFiles%\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" - cmake -G "Visual Studio 17 2022" -DCMAKE_BUILD_TYPE=Release -DPPC_BUILD_PPC_TESTS=True -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows .. - msbuild dingusppc.sln + cmake -S . -B build -G "${{ matrix.generator }}" -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} -DDPPC_68K_DEBUGGER=ON -DDPPC_BUILD_PPC_TESTS=ON ${{ matrix.ccache_args }} -DCMAKE_TOOLCHAIN_FILE=%VCPKG_INSTALLATION_ROOT%/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows ${{ matrix.cmake_args }} + cmake --build build --config ${{ env.BUILD_TYPE }} --parallel + - name: ccache stats + if: matrix.generator == 'Ninja' + shell: cmd + run: | + ccache --show-stats + if %errorlevel% neq 0 echo ccache stats unavailable + - name: Test + working-directory: ${{github.workspace}}/build + run: ctest -C ${{env.BUILD_TYPE}} --output-on-failure + - name: Upload logs on failure + if: failure() + uses: actions/upload-artifact@v4 + with: + name: logs-${{ github.job }}-${{ matrix.name }} + path: | + ${{ github.workspace }}/build/Testing/Temporary/LastTest.log + ${{ github.workspace }}/build/CMakeFiles/CMakeOutput.log + ${{ github.workspace }}/build/CMakeFiles/CMakeError.log + if-no-files-found: ignore + retention-days: ${{ github.event_name == 'pull_request' && 7 || 30 }} - name: Upload artifact if: always() uses: actions/upload-artifact@v4 with: - name: DingusPPC-MSBUILD + name: DingusPPC-${{ matrix.upload_suffix }} path: ${{github.workspace}}/build/bin + retention-days: ${{ github.event_name == 'pull_request' && 7 || 30 }} diff --git a/CMakeLists.txt b/CMakeLists.txt index ee549c749c..30ab93df94 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -147,7 +147,8 @@ add_executable(dingusppc ${SOURCES} $ $) if (WIN32) - target_link_libraries(dingusppc PRIVATE SDL2::SDL2 SDL2::SDL2main cubeb) + target_link_libraries(dingusppc PRIVATE SDL2::SDL2 cubeb) + target_compile_definitions(dingusppc PRIVATE SDL_MAIN_HANDLED) elseif (EMSCRIPTEN) target_link_libraries(dingusppc PRIVATE ${CMAKE_DL_LIBS} ${CMAKE_THREAD_LIBS_INIT} @@ -159,7 +160,7 @@ elseif (EMSCRIPTEN) "-s EXPORT_NAME=emulator" "-s 'EXTRA_EXPORTED_RUNTIME_METHODS=[\"FS\"]'") else() - target_link_libraries(dingusppc PRIVATE SDL2::SDL2 SDL2::SDL2main cubeb + target_link_libraries(dingusppc PRIVATE SDL2::SDL2main SDL2::SDL2 cubeb ${CMAKE_DL_LIBS} ${CMAKE_THREAD_LIBS_INIT}) endif() @@ -183,9 +184,10 @@ if (DPPC_BUILD_PPC_TESTS) $) if (WIN32) - target_link_libraries(testppc PRIVATE SDL2::SDL2 SDL2::SDL2main cubeb) + target_link_libraries(testppc PRIVATE SDL2::SDL2 cubeb) + target_compile_definitions(testppc PRIVATE SDL_MAIN_HANDLED) else() - target_link_libraries(testppc PRIVATE SDL2::SDL2 SDL2::SDL2main cubeb + target_link_libraries(testppc PRIVATE SDL2::SDL2main SDL2::SDL2 cubeb ${CMAKE_DL_LIBS} ${CMAKE_THREAD_LIBS_INIT}) endif() @@ -208,8 +210,11 @@ if (DPPC_BUILD_BENCHMARKS) $ $) - target_link_libraries(bench1 PRIVATE cubeb SDL2::SDL2 SDL2::SDL2main ${CMAKE_DL_LIBS} + target_link_libraries(bench1 PRIVATE cubeb SDL2::SDL2 ${CMAKE_DL_LIBS} ${CMAKE_THREAD_LIBS_INIT}) + if (WIN32) + target_compile_definitions(bench1 PRIVATE SDL_MAIN_HANDLED) + endif() if (DPPC_68K_DEBUGGER) target_link_libraries(bench1 PRIVATE capstone)