[cmake] Solve OpenSSL once and for all
All checks were successful
eden-license / license-header (pull_request) Successful in 28s
All checks were successful
eden-license / license-header (pull_request) Successful in 28s
Finally... Signed-off-by: crueter <crueter@crueter.xyz>
This commit is contained in:
parent
d9442ac3b8
commit
ccd05a0c98
4 changed files with 50 additions and 33 deletions
|
@ -174,27 +174,6 @@ endif()
|
||||||
if (ANDROID)
|
if (ANDROID)
|
||||||
set(CMAKE_SKIP_INSTALL_RULES ON)
|
set(CMAKE_SKIP_INSTALL_RULES ON)
|
||||||
set(CMAKE_POLICY_VERSION_MINIMUM 3.5) # Workaround for Oboe
|
set(CMAKE_POLICY_VERSION_MINIMUM 3.5) # Workaround for Oboe
|
||||||
|
|
||||||
include(CPMUtil)
|
|
||||||
|
|
||||||
# download openssl
|
|
||||||
# TODO(crueter): windows
|
|
||||||
if (ENABLE_OPENSSL)
|
|
||||||
set(BUILD_SHARED_LIBS ON)
|
|
||||||
AddPackage(
|
|
||||||
NAME OpenSSL
|
|
||||||
REPO crueter/OpenSSL-CI
|
|
||||||
TAG v3.5.2
|
|
||||||
VERSION 3.5.2
|
|
||||||
ARTIFACT openssl-android-3.5.2.tar.zst
|
|
||||||
|
|
||||||
KEY android
|
|
||||||
HASH_SUFFIX sha512sum
|
|
||||||
BUNDLED_PACKAGE ON
|
|
||||||
)
|
|
||||||
|
|
||||||
include(${OpenSSL_SOURCE_DIR}/openssl.cmake)
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (YUZU_USE_PRECOMPILED_HEADERS)
|
if (YUZU_USE_PRECOMPILED_HEADERS)
|
||||||
|
@ -391,16 +370,6 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
|
||||||
# System imported libraries
|
# System imported libraries
|
||||||
# =======================================================================
|
# =======================================================================
|
||||||
|
|
||||||
if(ENABLE_OPENSSL)
|
|
||||||
if (MSVC)
|
|
||||||
# default for slproweb
|
|
||||||
set(OPENSSL_ROOT_DIR "C:/Program Files/OpenSSL-Win64" CACHE STRING "OpenSSL install path")
|
|
||||||
message(STATUS "OpenSSL root dir set to ${OPENSSL_ROOT_DIR}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
find_package(OpenSSL 1.1.1 REQUIRED)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (YUZU_USE_CPM)
|
if (YUZU_USE_CPM)
|
||||||
include(CPMUtil)
|
include(CPMUtil)
|
||||||
message(STATUS "Fetching needed dependencies with CPM")
|
message(STATUS "Fetching needed dependencies with CPM")
|
||||||
|
@ -410,6 +379,43 @@ if (YUZU_USE_CPM)
|
||||||
|
|
||||||
# TODO(crueter): renderdoc?
|
# TODO(crueter): renderdoc?
|
||||||
|
|
||||||
|
# openssl funniness
|
||||||
|
if (ENABLE_OPENSSL)
|
||||||
|
if (MSVC)
|
||||||
|
set(BUILD_SHARED_LIBS OFF)
|
||||||
|
AddPackage(
|
||||||
|
NAME OpenSSL
|
||||||
|
REPO crueter/OpenSSL-CI
|
||||||
|
TAG v3.5.2
|
||||||
|
VERSION 3.5.2
|
||||||
|
ARTIFACT openssl-windows-3.5.2.tar.zst
|
||||||
|
|
||||||
|
KEY windows
|
||||||
|
HASH_SUFFIX sha512sum
|
||||||
|
BUNDLED_PACKAGE ON
|
||||||
|
)
|
||||||
|
|
||||||
|
include(${OpenSSL_SOURCE_DIR}/openssl.cmake)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (ANDROID)
|
||||||
|
set(BUILD_SHARED_LIBS OFF)
|
||||||
|
AddPackage(
|
||||||
|
NAME OpenSSL
|
||||||
|
REPO crueter/OpenSSL-CI
|
||||||
|
TAG v3.5.2
|
||||||
|
VERSION 3.5.2
|
||||||
|
ARTIFACT openssl-android-3.5.2.tar.zst
|
||||||
|
|
||||||
|
KEY android
|
||||||
|
HASH_SUFFIX sha512sum
|
||||||
|
BUNDLED_PACKAGE ON
|
||||||
|
)
|
||||||
|
|
||||||
|
include(${OpenSSL_SOURCE_DIR}/openssl.cmake)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
AddPackage(
|
AddPackage(
|
||||||
NAME Boost
|
NAME Boost
|
||||||
REPO boostorg/boost
|
REPO boostorg/boost
|
||||||
|
@ -531,6 +537,10 @@ else()
|
||||||
if (CMAKE_SYSTEM_NAME STREQUAL "Linux" OR ANDROID)
|
if (CMAKE_SYSTEM_NAME STREQUAL "Linux" OR ANDROID)
|
||||||
find_package(gamemode 1.7 MODULE)
|
find_package(gamemode 1.7 MODULE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if (ENABLE_OPENSSL)
|
||||||
|
find_package(OpenSSL 1.1.1 REQUIRED)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (ENABLE_LIBUSB)
|
if (ENABLE_LIBUSB)
|
||||||
|
|
|
@ -35,6 +35,7 @@ function(download_bundled_external remote_path lib_name cpm_key prefix_var versi
|
||||||
URL ${full_url}
|
URL ${full_url}
|
||||||
DOWNLOAD_ONLY YES
|
DOWNLOAD_ONLY YES
|
||||||
KEY ${CACHE_KEY}
|
KEY ${CACHE_KEY}
|
||||||
|
BUNDLED_PACKAGE ON
|
||||||
# TODO(crueter): hash
|
# TODO(crueter): hash
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -1249,7 +1249,7 @@ if(ENABLE_OPENSSL)
|
||||||
find_package(OpenSSL REQUIRED)
|
find_package(OpenSSL REQUIRED)
|
||||||
target_sources(core PRIVATE
|
target_sources(core PRIVATE
|
||||||
hle/service/ssl/ssl_backend_openssl.cpp)
|
hle/service/ssl/ssl_backend_openssl.cpp)
|
||||||
if (ANDROID)
|
if (ANDROID OR MSVC)
|
||||||
link_openssl(core)
|
link_openssl(core)
|
||||||
else()
|
else()
|
||||||
target_link_libraries(core PRIVATE OpenSSL::SSL)
|
target_link_libraries(core PRIVATE OpenSSL::SSL)
|
||||||
|
|
|
@ -18,7 +18,13 @@ find_package(OpenSSL REQUIRED)
|
||||||
|
|
||||||
create_target_directory_groups(web_service)
|
create_target_directory_groups(web_service)
|
||||||
target_include_directories(web_service PUBLIC ${cpp-jwt_SOURCE_DIR}/include)
|
target_include_directories(web_service PUBLIC ${cpp-jwt_SOURCE_DIR}/include)
|
||||||
target_link_libraries(web_service PRIVATE common network nlohmann_json::nlohmann_json httplib::httplib OpenSSL::SSL cpp-jwt::cpp-jwt)
|
target_link_libraries(web_service PRIVATE common network nlohmann_json::nlohmann_json httplib::httplib cpp-jwt::cpp-jwt)
|
||||||
|
|
||||||
|
if (ANDROID OR MSVC)
|
||||||
|
link_openssl(web_service)
|
||||||
|
else()
|
||||||
|
target_link_libraries(web_service PRIVATE OpenSSL::SSL)
|
||||||
|
endif()
|
||||||
|
|
||||||
if (YUZU_USE_PRECOMPILED_HEADERS)
|
if (YUZU_USE_PRECOMPILED_HEADERS)
|
||||||
target_precompile_headers(web_service PRIVATE precompiled_headers.h)
|
target_precompile_headers(web_service PRIVATE precompiled_headers.h)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue