Created
December 11, 2025 13:25
-
-
Save 8Observer8/f64b3b73769f279842711e5477d15607 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cmake_minimum_required(VERSION 3.21) | |
| project(play-audio-sdl3-c) | |
| add_executable(app) | |
| # Specify where the application source files are stored | |
| target_sources(app | |
| PRIVATE | |
| src/main.c | |
| ) | |
| # Check for WebAssembly | |
| if (CMAKE_SYSTEM_NAME MATCHES "Emscripten") | |
| target_link_options("app" PRIVATE "SHELL:--embed-file ${CMAKE_CURRENT_SOURCE_DIR}/assets/audio/picked-coin-echo-2.wav@/assets/audio/picked-coin-echo-2.wav") | |
| set_property(TARGET "app" APPEND PROPERTY LINK_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/assets/audio/picked-coin-echo-2.wav") | |
| endif() | |
| # Check for Windows | |
| if (WIN32) | |
| # Copy DLL's to the dist folder | |
| add_custom_command(TARGET app POST_BUILD | |
| COMMAND ${CMAKE_COMMAND} -E copy_if_different | |
| $<TARGET_RUNTIME_DLLS:app> $<TARGET_FILE_DIR:app> | |
| COMMAND_EXPAND_LISTS | |
| ) | |
| target_link_options(app PRIVATE -static) | |
| endif() | |
| find_package(SDL3) | |
| find_package(SDL3_mixer) | |
| target_link_libraries(app PRIVATE SDL3_mixer::SDL3_mixer SDL3::SDL3) | |
| # For comments: | |
| #[===[ | |
| # Some content here | |
| #]===] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment