[cmake] refactor: CPM over vcpkg #250
4 changed files with 50 additions and 33 deletions
|
@ -174,27 +174,6 @@ endif()
|
|||
if (ANDROID)
|
||||
set(CMAKE_SKIP_INSTALL_RULES ON)
|
||||
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()
|
||||
|
||||
if (YUZU_USE_PRECOMPILED_HEADERS)
|
||||
|
@ -391,16 +370,6 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
|
|||
# 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)
|
||||
include(CPMUtil)
|
||||
message(STATUS "Fetching needed dependencies with CPM")
|
||||
|
@ -410,6 +379,43 @@ if (YUZU_USE_CPM)
|
|||
|
||||
# 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(
|
||||
NAME Boost
|
||||
REPO boostorg/boost
|
||||
|
@ -531,6 +537,10 @@ else()
|
|||
if (CMAKE_SYSTEM_NAME STREQUAL "Linux" OR ANDROID)
|
||||
find_package(gamemode 1.7 MODULE)
|
||||
endif()
|
||||
|
||||
if (ENABLE_OPENSSL)
|
||||
find_package(OpenSSL 1.1.1 REQUIRED)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (ENABLE_LIBUSB)
|
||||
|
|
|
@ -35,6 +35,7 @@ function(download_bundled_external remote_path lib_name cpm_key prefix_var versi
|
|||
URL ${full_url}
|
||||
DOWNLOAD_ONLY YES
|
||||
KEY ${CACHE_KEY}
|
||||
BUNDLED_PACKAGE ON
|
||||
# TODO(crueter): hash
|
||||
)
|
||||
|
||||
|
|
|
@ -1249,7 +1249,7 @@ if(ENABLE_OPENSSL)
|
|||
find_package(OpenSSL REQUIRED)
|
||||
target_sources(core PRIVATE
|
||||
hle/service/ssl/ssl_backend_openssl.cpp)
|
||||
if (ANDROID)
|
||||
if (ANDROID OR MSVC)
|
||||
link_openssl(core)
|
||||
else()
|
||||
target_link_libraries(core PRIVATE OpenSSL::SSL)
|
||||
|
|
|
@ -18,7 +18,13 @@ find_package(OpenSSL REQUIRED)
|
|||
|
||||
create_target_directory_groups(web_service)
|
||||
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)
|
||||
target_precompile_headers(web_service PRIVATE precompiled_headers.h)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue