mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-14 13:27:45 -07:00
Merge 613c959bda
into 2c92e5b5b3
This commit is contained in:
commit
87351ef15e
@ -19,28 +19,27 @@ function(dolphin_make_imported_target_if_missing target lib)
|
|||||||
endif()
|
endif()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
function(dolphin_optional_system_library library)
|
function(dolphin_optional_system_library out_use_system library)
|
||||||
string(TOUPPER ${library} upperlib)
|
string(TOUPPER ${library} upperlib)
|
||||||
set(USE_SYSTEM_${upperlib} "" CACHE STRING "Use system ${library} instead of bundled. ON - Always use system and fail if unavailable, OFF - Always use bundled, AUTO - Use system if available, otherwise use bundled, blank - Delegate to USE_SYSTEM_LIBS. Default is blank.")
|
set(USE_SYSTEM_${upperlib} "" CACHE STRING "Use system ${library} instead of bundled. ON - Always use system and fail if unavailable, OFF - Always use bundled, AUTO - Use system if available, otherwise use bundled, blank - Delegate to USE_SYSTEM_LIBS. Default is blank.")
|
||||||
if("${USE_SYSTEM_${upperlib}}" STREQUAL "")
|
if("${USE_SYSTEM_${upperlib}}" STREQUAL "")
|
||||||
if(APPROVED_VENDORED_DEPENDENCIES)
|
if(APPROVED_VENDORED_DEPENDENCIES)
|
||||||
string(TOLOWER ${library} lowerlib)
|
string(TOLOWER ${library} lowerlib)
|
||||||
if(lowerlib IN_LIST APPROVED_VENDORED_DEPENDENCIES)
|
if(lowerlib IN_LIST APPROVED_VENDORED_DEPENDENCIES)
|
||||||
set(RESOLVED_USE_SYSTEM_${upperlib} AUTO PARENT_SCOPE)
|
set(${out_use_system} AUTO PARENT_SCOPE)
|
||||||
else()
|
else()
|
||||||
set(RESOLVED_USE_SYSTEM_${upperlib} ON PARENT_SCOPE)
|
set(${out_use_system} ON PARENT_SCOPE)
|
||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
set(RESOLVED_USE_SYSTEM_${upperlib} ${USE_SYSTEM_LIBS} PARENT_SCOPE)
|
set(${out_use_system} ${USE_SYSTEM_LIBS} PARENT_SCOPE)
|
||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
set(RESOLVED_USE_SYSTEM_${upperlib} ${USE_SYSTEM_${upperlib}} PARENT_SCOPE)
|
set(${out_use_system} ${USE_SYSTEM_${upperlib}} PARENT_SCOPE)
|
||||||
endif()
|
endif()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
function(dolphin_add_bundled_library library bundled_path)
|
function(dolphin_add_bundled_library library use_system bundled_path)
|
||||||
string(TOUPPER ${library} upperlib)
|
if (${use_system} STREQUAL "AUTO")
|
||||||
if (${RESOLVED_USE_SYSTEM_${upperlib}} STREQUAL "AUTO")
|
|
||||||
message(STATUS "No system ${library} was found. Using static ${library} from Externals.")
|
message(STATUS "No system ${library} was found. Using static ${library} from Externals.")
|
||||||
else()
|
else()
|
||||||
message(STATUS "Using static ${library} from Externals")
|
message(STATUS "Using static ${library} from Externals")
|
||||||
@ -52,9 +51,9 @@ function(dolphin_add_bundled_library library bundled_path)
|
|||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
function(dolphin_find_optional_system_library library bundled_path)
|
function(dolphin_find_optional_system_library library bundled_path)
|
||||||
dolphin_optional_system_library(${library})
|
dolphin_optional_system_library(use_system ${library})
|
||||||
string(TOUPPER ${library} upperlib)
|
string(TOUPPER ${library} upperlib)
|
||||||
if(RESOLVED_USE_SYSTEM_${upperlib})
|
if(use_system)
|
||||||
find_package(${library} ${ARGN})
|
find_package(${library} ${ARGN})
|
||||||
# Yay for cmake packages being inconsistent
|
# Yay for cmake packages being inconsistent
|
||||||
if(DEFINED ${library}_FOUND)
|
if(DEFINED ${library}_FOUND)
|
||||||
@ -62,7 +61,7 @@ function(dolphin_find_optional_system_library library bundled_path)
|
|||||||
else()
|
else()
|
||||||
set(prefix ${upperlib})
|
set(prefix ${upperlib})
|
||||||
endif()
|
endif()
|
||||||
if((NOT ${found}) AND (NOT ${RESOLVED_USE_SYSTEM_${upperlib}} STREQUAL "AUTO"))
|
if((NOT ${prefix}_FOUND) AND (NOT ${use_system} STREQUAL "AUTO"))
|
||||||
message(FATAL_ERROR "No system ${library} was found. Please install it or set USE_SYSTEM_${upperlib} to AUTO or OFF.")
|
message(FATAL_ERROR "No system ${library} was found. Please install it or set USE_SYSTEM_${upperlib} to AUTO or OFF.")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
@ -70,17 +69,17 @@ function(dolphin_find_optional_system_library library bundled_path)
|
|||||||
message(STATUS "Using system ${library}")
|
message(STATUS "Using system ${library}")
|
||||||
set(${prefix}_TYPE "System" PARENT_SCOPE)
|
set(${prefix}_TYPE "System" PARENT_SCOPE)
|
||||||
else()
|
else()
|
||||||
dolphin_add_bundled_library(${library} ${bundled_path})
|
dolphin_add_bundled_library(${library} ${use_system} ${bundled_path})
|
||||||
set(${prefix}_TYPE "Bundled" PARENT_SCOPE)
|
set(${prefix}_TYPE "Bundled" PARENT_SCOPE)
|
||||||
endif()
|
endif()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
function(dolphin_find_optional_system_library_pkgconfig library search alias bundled_path)
|
function(dolphin_find_optional_system_library_pkgconfig library search alias bundled_path)
|
||||||
dolphin_optional_system_library(${library})
|
dolphin_optional_system_library(use_system ${library})
|
||||||
string(TOUPPER ${library} upperlib)
|
string(TOUPPER ${library} upperlib)
|
||||||
if(RESOLVED_USE_SYSTEM_${upperlib})
|
if(use_system)
|
||||||
pkg_search_module(${library} ${search} ${ARGN} IMPORTED_TARGET)
|
pkg_search_module(${library} ${search} ${ARGN} IMPORTED_TARGET)
|
||||||
if((NOT ${library}_FOUND) AND (NOT ${RESOLVED_USE_SYSTEM_${upperlib}} STREQUAL "AUTO"))
|
if((NOT ${library}_FOUND) AND (NOT ${use_system} STREQUAL "AUTO"))
|
||||||
message(FATAL_ERROR "No system ${library} was found. Please install it or set USE_SYSTEM_${upperlib} to AUTO or OFF.")
|
message(FATAL_ERROR "No system ${library} was found. Please install it or set USE_SYSTEM_${upperlib} to AUTO or OFF.")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
@ -89,7 +88,7 @@ function(dolphin_find_optional_system_library_pkgconfig library search alias bun
|
|||||||
dolphin_alias_library(${alias} PkgConfig::${library})
|
dolphin_alias_library(${alias} PkgConfig::${library})
|
||||||
set(${library}_TYPE "System" PARENT_SCOPE)
|
set(${library}_TYPE "System" PARENT_SCOPE)
|
||||||
else()
|
else()
|
||||||
dolphin_add_bundled_library(${library} ${bundled_path})
|
dolphin_add_bundled_library(${library} ${use_system} ${bundled_path})
|
||||||
set(${library}_TYPE "Bundled" PARENT_SCOPE)
|
set(${library}_TYPE "Bundled" PARENT_SCOPE)
|
||||||
endif()
|
endif()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
Loading…
Reference in New Issue
Block a user