Compile SDL with wayland support
This commit is contained in:
parent
40fcc634ef
commit
ad7add9bec
7 changed files with 36 additions and 29 deletions
|
|
@ -25,6 +25,7 @@ option(USE_MEMORYSAN "Enable Memory Sanitizer" OFF)
|
|||
option(NO_CONAN_BUILD "Not using conan to get packages" OFF)
|
||||
option(CONFIG_NEXT_TO_EXECUTABLE "Place configuration folder next to executable (portable executable)" OFF)
|
||||
option(MACOS_MAKE_BUNDLE "Package the application as a bundle" ON)
|
||||
option(ADD_PREFER_X11_OPTION "Adds an internal Prefer X11 option" OFF)
|
||||
|
||||
# Setting sources
|
||||
set(sources "src/main.cpp"
|
||||
|
|
@ -213,7 +214,7 @@ else()
|
|||
endif()
|
||||
|
||||
if(NOT EMSCRIPTEN)
|
||||
if(NOT ANDROID)
|
||||
if((NOT ANDROID) AND (NOT LINUX))
|
||||
find_package(SDL3 REQUIRED CONFIG REQUIRED COMPONENTS SDL3-shared)
|
||||
endif()
|
||||
find_package(LibDataChannel REQUIRED)
|
||||
|
|
@ -337,6 +338,10 @@ if(WIN32)
|
|||
target_compile_definitions(main PRIVATE WIN32_LEAN_AND_MEAN NOMINMAX)
|
||||
endif()
|
||||
|
||||
if(ADD_PREFER_X11_OPTION)
|
||||
target_compile_definitions(main PRIVATE ADD_PREFER_X11_OPTION)
|
||||
endif()
|
||||
|
||||
if(CONFIG_NEXT_TO_EXECUTABLE)
|
||||
target_compile_definitions(main PRIVATE CONFIG_NEXT_TO_EXECUTABLE)
|
||||
message("Place config next to executable")
|
||||
|
|
@ -389,6 +394,15 @@ endif()
|
|||
|
||||
if(ANDROID)
|
||||
add_subdirectory(deps/SDL EXCLUDE_FROM_ALL)
|
||||
elseif(LINUX)
|
||||
set(SDL_TEST_LIBRARY OFF CACHE BOOL "Compile SDL test library")
|
||||
set(SDL_TESTS OFF CACHE BOOL "Compile SDL tests")
|
||||
set(SDL_INSTALL_DOCS OFF CACHE BOOL "Install docs")
|
||||
set(SDL_INSTALL_TESTS OFF CACHE BOOL "Install tests")
|
||||
set(SDL_WAYLAND ON CACHE BOOL "Compile SDL for Wayland")
|
||||
set(SDL_X11 ON CACHE BOOL "Compile SDL for X11")
|
||||
set(SDL_AUDIO OFF CACHE BOOL "Compile SDL Audio")
|
||||
add_subdirectory(deps/SDL EXCLUDE_FROM_ALL)
|
||||
endif()
|
||||
|
||||
if(NO_CONAN_BUILD)
|
||||
|
|
@ -397,7 +411,7 @@ if(NO_CONAN_BUILD)
|
|||
target_link_libraries(main SDL3::SDL3 ICU::uc Fontconfig::Fontconfig Freetype::Freetype PNG::PNG ZLIB::ZLIB)
|
||||
else()
|
||||
target_link_libraries(main skia-infinipaint::skia-infinipaint)
|
||||
if(ANDROID)
|
||||
if(ANDROID OR LINUX)
|
||||
target_link_libraries(main SDL3::SDL3)
|
||||
else()
|
||||
target_link_libraries(main sdl-infinipaint::sdl-infinipaint)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue