File tree Expand file tree Collapse file tree 2 files changed +216
-291
lines changed
Expand file tree Collapse file tree 2 files changed +216
-291
lines changed Original file line number Diff line number Diff line change @@ -173,16 +173,26 @@ if(NOT CMAKE_SYSTEM_NAME STREQUAL "Windows")
173173endif ()
174174
175175if (DIRKSIMPLE_SDL)
176- find_package (SDL2 REQUIRED)
176+ if (EMSCRIPTEN)
177+ # FetchContent downloads and configures dependencies
178+ include (FetchContent)
179+ FetchContent_Declare(
180+ SDL3
181+ GIT_REPOSITORY "https://github.com/libsdl-org/SDL.git"
182+ GIT_TAG "main"
183+ EXCLUDE_FROM_ALL
184+ )
185+ FetchContent_MakeAvailable(SDL3)
186+ else ()
187+ find_package (SDL3 REQUIRED)
188+ endif ()
177189 add_executable (dirksimple dirksimple.c dirksimple_sdl.c)
178190 target_include_directories (dirksimple PRIVATE
179- ${SDL2_INCLUDE_DIRS} ${SDL2_INCLUDE_DIR}
180191 thirdparty/lua/src
181192 thirdparty/theoraplay
182193 thirdparty/lodepng
183194 )
184- target_link_libraries (dirksimple ${SDL2_LIBRARIES} ${SDL2_LIBRARY} )
185- target_link_libraries (dirksimple dirksimple-theoraplay dirksimple-theora dirksimple-vorbis dirksimple-ogg dirksimple-lodepng dirksimple-lua)
195+ target_link_libraries (dirksimple SDL3::SDL3 dirksimple-theoraplay dirksimple-theora dirksimple-vorbis dirksimple-ogg dirksimple-lodepng dirksimple-lua)
186196 if (USE_PTHREAD)
187197 target_link_libraries (dirksimple pthread)
188198 endif ()
You can’t perform that action at this time.
0 commit comments