Threading for renderer, textures, entities, game state
This commit is contained in:
@@ -7,11 +7,18 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
# Include FetchContent to download SDL from source
|
||||
include(FetchContent)
|
||||
|
||||
# Download SDL2 from source
|
||||
# Download SDL3 from source
|
||||
FetchContent_Declare(
|
||||
SDL2
|
||||
SDL3
|
||||
GIT_REPOSITORY https://github.com/libsdl-org/SDL.git
|
||||
GIT_TAG release-2.30.3
|
||||
GIT_TAG release-3.4.2
|
||||
)
|
||||
|
||||
# Download SDL3_image from source
|
||||
FetchContent_Declare(
|
||||
SDL3_image
|
||||
GIT_REPOSITORY https://github.com/libsdl-org/SDL_image.git
|
||||
GIT_TAG release-3.2.4
|
||||
)
|
||||
|
||||
# Work around PipeWire API mismatch on some Linux distributions.
|
||||
@@ -19,8 +26,9 @@ FetchContent_Declare(
|
||||
set(SDL_PIPEWIRE OFF CACHE BOOL "Disable SDL PipeWire backend" FORCE)
|
||||
set(SDL_PIPEWIRE_SHARED OFF CACHE BOOL "Disable dynamic PipeWire loading in SDL" FORCE)
|
||||
|
||||
# Make SDL available
|
||||
FetchContent_MakeAvailable(SDL2)
|
||||
# Make SDL libraries available
|
||||
FetchContent_MakeAvailable(SDL3)
|
||||
FetchContent_MakeAvailable(SDL3_image)
|
||||
|
||||
# Collect all source files from src/ and nested directories
|
||||
file(GLOB_RECURSE SOURCES CONFIGURE_DEPENDS "src/*.cpp")
|
||||
@@ -31,5 +39,5 @@ add_executable(${PROJECT_NAME} ${SOURCES})
|
||||
# Include headers from include/
|
||||
target_include_directories(${PROJECT_NAME} PRIVATE include)
|
||||
|
||||
# Link SDL2 to the executable
|
||||
target_link_libraries(${PROJECT_NAME} PRIVATE SDL2::SDL2)
|
||||
# Link SDL3 and SDL3_image to the executable
|
||||
target_link_libraries(${PROJECT_NAME} PRIVATE SDL3::SDL3 SDL3_image::SDL3_image)
|
||||
|
||||
Reference in New Issue
Block a user