Fail configuration if X11 dependency packages aren't available
It happens fairly often that people enable X11 support but don't install the extension libraries that SDL depends on. This makes those required if not explicitly disabled, which should help prevent accidentally broken builds.
This commit is contained in:
@@ -417,7 +417,7 @@ function(SDL_PrintSummary)
|
||||
"Most likely, this is not wanted."
|
||||
"\n"
|
||||
"On Linux, install the packages listed at "
|
||||
"https://github.com/libsdl-org/SDL/blob/main/docs/README-linux.md#build-dependencies "
|
||||
"https://wiki.libsdl.org/SDL3/README-linux#build-dependencies "
|
||||
"\n"
|
||||
"If you really don't need desktop windows, the documentation tells you how to skip this check. "
|
||||
"https://github.com/libsdl-org/SDL/blob/main/docs/README-cmake.md#cmake-fails-to-build-without-x11-or-wayland-support\n"
|
||||
@@ -427,6 +427,22 @@ function(SDL_PrintSummary)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function(SDL_missing_dependency NAME OPTION)
|
||||
if(LINUX)
|
||||
message( FATAL_ERROR
|
||||
"Couldn't find dependency package for ${NAME}. Please install the needed packages or configure with -D${OPTION}=OFF"
|
||||
"\n"
|
||||
"The full set of dependencies is available at "
|
||||
"https://wiki.libsdl.org/SDL3/README-linux#build-dependencies "
|
||||
"\n"
|
||||
)
|
||||
else()
|
||||
message( FATAL_ERROR
|
||||
"Couldn't find dependency package for ${NAME}. Please install the needed packages or configure with -D${OPTION}=OFF"
|
||||
)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function(SDL_install_pdb TARGET DIRECTORY)
|
||||
get_property(type TARGET ${TARGET} PROPERTY TYPE)
|
||||
if(type MATCHES "^(SHARED_LIBRARY|EXECUTABLE)$")
|
||||
|
||||
Reference in New Issue
Block a user