mirror of https://github.com/axmolengine/axmol.git
Update to 3rdparty v82 (#1803)
* Add 3rdParty v82 * Fix openssl target linking * Use alias target for OpenSSL on all platforms
This commit is contained in:
parent
d37f23997a
commit
5cb5ce79c3
|
@ -305,8 +305,6 @@ add_subdirectory(openssl)
|
|||
if(ANDROID OR LINUX)
|
||||
target_link_libraries(OpenSSL::SSL INTERFACE OpenSSL::Crypto)
|
||||
target_link_libraries(3rdparty INTERFACE OpenSSL::SSL)
|
||||
elseif(APPLE)
|
||||
target_link_libraries(3rdparty INTERFACE openssl)
|
||||
else()
|
||||
target_link_libraries(3rdparty
|
||||
INTERFACE OpenSSL::Crypto
|
||||
|
|
|
@ -7,57 +7,49 @@ _1kfetch_dist(openssl)
|
|||
|
||||
set(OPENSSL_INCLUDE_DIR "${openssl_INC_DIR}" CACHE STRING "OpenSSL include dir" FORCE)
|
||||
|
||||
if(NOT APPLE)
|
||||
# -----macro: set openssl sub target-----
|
||||
macro(set_openssl_sub_target sub_target_name sub_lib_name)
|
||||
|
||||
if(WINDOWS)
|
||||
add_library(${sub_target_name} SHARED IMPORTED GLOBAL)
|
||||
else()
|
||||
add_library(${sub_target_name} STATIC IMPORTED GLOBAL)
|
||||
endif()
|
||||
# -----macro: set openssl sub target-----
|
||||
macro(set_openssl_sub_target sub_target_name sub_lib_name)
|
||||
|
||||
set_target_properties(${sub_target_name} PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${openssl_INC_DIR}"
|
||||
)
|
||||
|
||||
set(imp_lib_name "")
|
||||
if(WINDOWS)
|
||||
set(impl_lib_suffix "")
|
||||
if(WIN64)
|
||||
set(impl_lib_suffix "-${ARCH_ALIAS}")
|
||||
endif()
|
||||
set(imp_lib_name "${openssl_LIB_DIR}/lib${sub_lib_name}.lib")
|
||||
set_target_properties(${sub_target_name} PROPERTIES
|
||||
IMPORTED_LOCATION "${openssl_LIB_DIR}/lib${sub_lib_name}-3${impl_lib_suffix}.dll"
|
||||
IMPORTED_IMPLIB "${openssl_LIB_DIR}/lib${sub_lib_name}.lib"
|
||||
)
|
||||
else()
|
||||
set(imp_lib_name "${openssl_LIB_DIR}/lib${sub_lib_name}.a")
|
||||
set_target_properties(${sub_target_name} PROPERTIES
|
||||
IMPORTED_LOCATION "${openssl_LIB_DIR}/lib${sub_lib_name}.a"
|
||||
)
|
||||
endif()
|
||||
if(${sub_lib_name} STREQUAL "ssl")
|
||||
set(OPENSSL_ROOT_DIR "${openssl_LIB_DIR}" CACHE STRING "" FORCE)
|
||||
set(OPENSSL_SSL_LIBRARY "${imp_lib_name}" CACHE STRING "" FORCE)
|
||||
else()
|
||||
set(OPENSSL_CRYPTO_LIBRARY "${imp_lib_name}" CACHE STRING "" FORCE)
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
# -----sub target 1: ssl-----
|
||||
set(target_name OpenSSL::SSL ssl)
|
||||
set_openssl_sub_target(${target_name})
|
||||
|
||||
# -----sub target 2: crypto-----
|
||||
set(target_name OpenSSL::Crypto crypto)
|
||||
set_openssl_sub_target(${target_name})
|
||||
if(WINDOWS)
|
||||
add_library(${sub_target_name} SHARED IMPORTED GLOBAL)
|
||||
else()
|
||||
set(target_name ${lib_name})
|
||||
add_library(${target_name} STATIC IMPORTED GLOBAL)
|
||||
set_target_properties(${target_name} PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${openssl_INC_DIR}"
|
||||
IMPORTED_LOCATION "${openssl_LIB_DIR}/openssl.xcframework"
|
||||
)
|
||||
add_library(${sub_target_name} STATIC IMPORTED GLOBAL)
|
||||
endif()
|
||||
|
||||
set_target_properties(${sub_target_name} PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${openssl_INC_DIR}"
|
||||
)
|
||||
|
||||
if(WINDOWS)
|
||||
set(impl_lib_suffix "")
|
||||
if(WIN64)
|
||||
set(impl_lib_suffix "-${ARCH_ALIAS}")
|
||||
endif()
|
||||
set_target_properties(${sub_target_name} PROPERTIES
|
||||
IMPORTED_LOCATION "${openssl_LIB_DIR}/lib${sub_lib_name}-3${impl_lib_suffix}.dll"
|
||||
IMPORTED_IMPLIB "${openssl_LIB_DIR}/lib${sub_lib_name}.lib"
|
||||
)
|
||||
elseif(APPLE)
|
||||
set_target_properties(${sub_target_name} PROPERTIES
|
||||
IMPORTED_LOCATION "${openssl_LIB_DIR}/ossl-${sub_lib_name}.xcframework"
|
||||
)
|
||||
else()
|
||||
set_target_properties(${sub_target_name} PROPERTIES
|
||||
IMPORTED_LOCATION "${openssl_LIB_DIR}/lib${sub_lib_name}.a"
|
||||
)
|
||||
endif()
|
||||
if(${sub_lib_name} STREQUAL "ssl")
|
||||
set(OPENSSL_ROOT_DIR "${openssl_LIB_DIR}" CACHE STRING "" FORCE)
|
||||
set(OPENSSL_SSL_LIBRARY "OpenSSL::SSL" CACHE STRING "" FORCE)
|
||||
else()
|
||||
set(OPENSSL_CRYPTO_LIBRARY "OpenSSL::Crypto" CACHE STRING "" FORCE)
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
# -----sub target 1: ssl-----
|
||||
set(target_name OpenSSL::SSL ssl)
|
||||
set_openssl_sub_target(${target_name})
|
||||
|
||||
# -----sub target 2: crypto-----
|
||||
set(target_name OpenSSL::Crypto crypto)
|
||||
set_openssl_sub_target(${target_name})
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"versions": {
|
||||
"1kdist": "v81",
|
||||
"1kdist": "v82",
|
||||
"oboe": "1.8.1",
|
||||
"kcp": "v1.7-f2aa30e",
|
||||
"lz4": "v1.9.4",
|
||||
|
|
Loading…
Reference in New Issue