mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-06-28 01:49:33 -06:00
CMake: Use targets for all optionally-external dependencies
This commit is contained in:
1
Externals/LZO/CMakeLists.txt
vendored
1
Externals/LZO/CMakeLists.txt
vendored
@ -7,3 +7,4 @@ target_include_directories(lzo2
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
add_library(LZO::LZO ALIAS lzo2)
|
||||
|
17
Externals/SDL/CMakeLists.txt
vendored
Normal file
17
Externals/SDL/CMakeLists.txt
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
option(SDL2_DISABLE_SDL2MAIN "" ON)
|
||||
option(SDL2_DISABLE_INSTALL "" ON)
|
||||
option(SDL2_DISABLE_UNINSTALL "" ON)
|
||||
set(SDL_SHARED OFF)
|
||||
set(SDL_SHARED_ENABLED_BY_DEFAULT OFF)
|
||||
set(SDL_STATIC ON)
|
||||
set(SDL_STATIC_ENABLED_BY_DEFAULT ON)
|
||||
set(SDL_TEST OFF)
|
||||
set(SDL_TEST_ENABLED_BY_DEFAULT OFF)
|
||||
set(OPT_DEF_LIBC ON)
|
||||
add_subdirectory(SDL)
|
||||
if (TARGET SDL2)
|
||||
dolphin_disable_warnings_msvc(SDL2)
|
||||
endif()
|
||||
if (TARGET SDL2-static)
|
||||
dolphin_disable_warnings_msvc(SDL2-static)
|
||||
endif()
|
10
Externals/SFML/CMakeLists.txt
vendored
10
Externals/SFML/CMakeLists.txt
vendored
@ -1,5 +1,3 @@
|
||||
include_directories(BEFORE include src)
|
||||
|
||||
set(SRC_NETWORK
|
||||
src/SFML/Network/Http.cpp
|
||||
src/SFML/Network/IPAddress.cpp
|
||||
@ -23,7 +21,11 @@ set(SRC_SYSTEM
|
||||
src/SFML/System/Time.cpp
|
||||
)
|
||||
|
||||
add_library(sfml-network ${SRC_NETWORK})
|
||||
add_library(sfml-system ${SRC_SYSTEM})
|
||||
add_library(sfml-network STATIC ${SRC_NETWORK})
|
||||
add_library(sfml-system STATIC ${SRC_SYSTEM})
|
||||
target_compile_definitions(sfml-system PUBLIC SFML_STATIC)
|
||||
target_include_directories(sfml-system PUBLIC include PRIVATE src)
|
||||
target_include_directories(sfml-network PUBLIC include PRIVATE src)
|
||||
target_link_libraries(sfml-network PUBLIC sfml-system)
|
||||
dolphin_disable_warnings_msvc(sfml-network)
|
||||
dolphin_disable_warnings_msvc(sfml-system)
|
||||
|
1
Externals/cubeb/CMakeLists.txt
vendored
1
Externals/cubeb/CMakeLists.txt
vendored
@ -352,3 +352,4 @@ if(USE_AUDIOUNIT AND USE_AUDIOUNIT_RUST)
|
||||
debug "${PROJECT_SOURCE_DIR}/cubeb/src/cubeb-coreaudio-rs/target/debug/libcubeb_coreaudio.a"
|
||||
optimized "${PROJECT_SOURCE_DIR}/cubeb/src/cubeb-coreaudio-rs/target/release/libcubeb_coreaudio.a")
|
||||
endif()
|
||||
add_library(cubeb::cubeb ALIAS cubeb)
|
||||
|
6
Externals/curl/lib/CMakeLists.txt
vendored
6
Externals/curl/lib/CMakeLists.txt
vendored
@ -4,8 +4,6 @@ else()
|
||||
add_definitions(-DHAVE_CONFIG_H)
|
||||
endif()
|
||||
|
||||
include_directories(.)
|
||||
|
||||
file(GLOB SRCS *.c vauth/*.c vtls/*.c)
|
||||
add_library(
|
||||
curl
|
||||
@ -14,5 +12,7 @@ add_library(
|
||||
)
|
||||
dolphin_disable_warnings_msvc(curl)
|
||||
|
||||
target_link_libraries(curl ${MBEDTLS_LIBRARIES} zlibstatic)
|
||||
target_include_directories(curl PRIVATE . INTERFACE ../include)
|
||||
target_link_libraries(curl MbedTLS::mbedtls zlibstatic)
|
||||
target_compile_definitions(curl PUBLIC CURL_STATICLIB PRIVATE CURL_DISABLE_LDAP)
|
||||
add_library(CURL::libcurl ALIAS curl)
|
||||
|
4
Externals/enet/CMakeLists.txt
vendored
4
Externals/enet/CMakeLists.txt
vendored
@ -59,8 +59,6 @@ if(HAS_SOCKLEN_T)
|
||||
add_definitions(-DHAS_SOCKLEN_T=1)
|
||||
endif()
|
||||
|
||||
include_directories(${PROJECT_SOURCE_DIR}/include)
|
||||
|
||||
set(INCLUDE_FILES_PREFIX include/enet)
|
||||
set(INCLUDE_FILES
|
||||
${INCLUDE_FILES_PREFIX}/callbacks.h
|
||||
@ -92,8 +90,10 @@ add_library(enet STATIC
|
||||
${INCLUDE_FILES}
|
||||
${SOURCE_FILES}
|
||||
)
|
||||
target_include_directories(enet PUBLIC include)
|
||||
|
||||
dolphin_disable_warnings_msvc(enet)
|
||||
add_library(enet::enet ALIAS enet)
|
||||
|
||||
if (MINGW)
|
||||
target_link_libraries(enet winmm ws2_32)
|
||||
|
5
Externals/libspng/CMakeLists.txt
vendored
5
Externals/libspng/CMakeLists.txt
vendored
@ -2,8 +2,9 @@ cmake_minimum_required(VERSION 3.0)
|
||||
|
||||
project(spng C)
|
||||
|
||||
add_library(spng STATIC ${CMAKE_CURRENT_LIST_DIR}/libspng/spng/spng.c)
|
||||
add_library(spng STATIC libspng/spng/spng.c)
|
||||
target_compile_definitions(spng PUBLIC SPNG_STATIC)
|
||||
target_link_libraries(spng PUBLIC ZLIB::ZLIB)
|
||||
target_include_directories(spng PUBLIC ${CMAKE_CURRENT_LIST_DIR}/libspng/spng/)
|
||||
target_include_directories(spng PUBLIC libspng/spng)
|
||||
dolphin_disable_warnings_msvc(spng)
|
||||
add_library(spng::spng ALIAS spng)
|
||||
|
1
Externals/libusb/CMakeLists.txt
vendored
1
Externals/libusb/CMakeLists.txt
vendored
@ -125,3 +125,4 @@ check_include_files(sys/timerfd.h HAVE_TIMERFD)
|
||||
check_include_files(unistd.h HAVE_UNISTD_H)
|
||||
|
||||
configure_file(config.h.in config.h)
|
||||
add_library(LibUSB::LibUSB ALIAS usb)
|
||||
|
1
Externals/mbedtls/library/CMakeLists.txt
vendored
1
Externals/mbedtls/library/CMakeLists.txt
vendored
@ -222,6 +222,7 @@ if(USE_SHARED_MBEDTLS_LIBRARY)
|
||||
endif(USE_SHARED_MBEDTLS_LIBRARY)
|
||||
|
||||
foreach(target IN LISTS target_libraries)
|
||||
add_library(MbedTLS::${target} ALIAS ${target}) # add_subdirectory support
|
||||
# Include public header files from /include and other directories
|
||||
# declared by /3rdparty/**/CMakeLists.txt. Include private header files
|
||||
# from /library and others declared by /3rdparty/**/CMakeLists.txt.
|
||||
|
2
Externals/minizip/CMakeLists.txt
vendored
2
Externals/minizip/CMakeLists.txt
vendored
@ -67,4 +67,4 @@ endif()
|
||||
|
||||
target_link_libraries(minizip PUBLIC ZLIB::ZLIB)
|
||||
|
||||
add_library(minizip-ng ALIAS minizip)
|
||||
add_library(minizip::minizip ALIAS minizip)
|
||||
|
Reference in New Issue
Block a user