cmake: use FindALSA.cmake to find ALSA libraries

Co-authored-by: nfarid <54642193+nfarid@users.noreply.github.com>
This commit is contained in:
Anonymous Maarten
2022-12-12 00:18:06 +01:00
parent 053ce39d67
commit 9eb4d1f020
7 changed files with 74 additions and 25 deletions

View File

@@ -18,6 +18,9 @@ endif()
set(EXTRA_LIBS)
set(EXTRA_LDFLAGS)
set(CMAKE_DEPENDS)
set(PKGCONFIG_DEPENDS)
# This is a virtual "library" that just exists to collect up compiler and
# linker options that used to be global to this CMake project. When you
# specify it as part of a real library's target_link_libraries(), that
@@ -27,7 +30,6 @@ set(EXTRA_LDFLAGS)
add_library(sdl-build-options INTERFACE)
if(WINDOWS_STORE)
cmake_minimum_required(VERSION 3.11.0)
target_compile_definitions(sdl-build-options INTERFACE "-DSDL_BUILDING_WINRT=1")
target_compile_options(sdl-build-options INTERFACE "-ZW")
endif()
@@ -3051,8 +3053,7 @@ if (SDL_ASAN)
endif()
endif()
if(SDL_CCACHE)
cmake_minimum_required(VERSION 3.4)
if(SDL_CCACHE AND NOT CMAKE_VERSION VERSION_LESS 3.4)
find_program(CCACHE_BINARY ccache)
if(CCACHE_BINARY)
set(CMAKE_C_COMPILER_LAUNCHER ${CCACHE_BINARY})
@@ -3062,6 +3063,8 @@ if(SDL_CCACHE)
else()
set(HAVE_CCACHE OFF)
endif()
else()
set(HAVE_CCACHE OFF)
endif()
if(SDL_TESTS)
@@ -3222,7 +3225,7 @@ if(SDL_SHARED)
set_target_properties(SDL3 PROPERTIES STATIC_LIBRARY_FLAGS "/NODEFAULTLIB")
endif()
# FIXME: if CMAKE_VERSION >= 3.13, use target_link_options for EXTRA_LDFLAGS
target_link_libraries(SDL3 PRIVATE ${EXTRA_LIBS} ${EXTRA_LDFLAGS} ${EXTRA_LDFLAGS_BUILD})
target_link_libraries(SDL3 PRIVATE ${EXTRA_LIBS} ${EXTRA_LDFLAGS} ${EXTRA_LDFLAGS_BUILD} ${CMAKE_DEPENDS})
target_include_directories(SDL3
PRIVATE
"$<BUILD_INTERFACE:${SDL3_BINARY_DIR}/include-config-$<LOWER_CASE:$<CONFIG>>>"
@@ -3257,7 +3260,7 @@ if(SDL_STATIC)
target_compile_definitions(SDL3-static PRIVATE SDL_STATIC_LIB)
# TODO: Win32 platforms keep the same suffix .lib for import and static
# libraries - do we need to consider this?
target_link_libraries(SDL3-static PRIVATE ${EXTRA_LIBS} ${EXTRA_LDFLAGS})
target_link_libraries(SDL3-static PRIVATE ${EXTRA_LIBS} ${EXTRA_LDFLAGS} ${CMAKE_DEPENDS})
target_include_directories(SDL3-static
PRIVATE
"$<BUILD_INTERFACE:${SDL3_BINARY_DIR}/include-config-$<LOWER_CASE:$<CONFIG>>>"
@@ -3402,6 +3405,7 @@ if(NOT SDL3_DISABLE_INSTALL)
FILES
${CMAKE_CURRENT_BINARY_DIR}/SDL3Config.cmake
${CMAKE_CURRENT_BINARY_DIR}/SDL3ConfigVersion.cmake
${SDL3_SOURCE_DIR}/cmake/sdlfind.cmake
DESTINATION "${SDL_INSTALL_CMAKEDIR}"
COMPONENT Devel
)