diff options
| author | 2017-09-11 16:16:11 -0400 | |
|---|---|---|
| committer | 2017-09-11 16:16:11 -0400 | |
| commit | 3e2e9be6d542042fbf0548e94f34c5274bf2f714 (patch) | |
| tree | 8f24b1769d89860390adeff8f9b390cdc4d725b1 | |
| parent | Merge pull request #2923 from B3n30/system_curl_osx (diff) | |
| parent | Build: Enable SSL in mingw by linking against WinSSL (diff) | |
| download | yuzu-3e2e9be6d542042fbf0548e94f34c5274bf2f714.tar.gz yuzu-3e2e9be6d542042fbf0548e94f34c5274bf2f714.tar.xz yuzu-3e2e9be6d542042fbf0548e94f34c5274bf2f714.zip | |
Merge pull request #2922 from jroweboy/mingw-telemetry
Build: Enable SSL in mingw by linking against WinSSL
| -rw-r--r-- | CMakeLists.txt | 28 | ||||
| -rw-r--r-- | CMakeModules/DownloadExternals.cmake | 18 | ||||
| -rw-r--r-- | appveyor.yml | 11 | ||||
| -rw-r--r-- | externals/CMakeLists.txt | 19 |
4 files changed, 49 insertions, 27 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index f8060270e..d9c2f78a2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
| @@ -2,6 +2,7 @@ | |||
| 2 | cmake_minimum_required(VERSION 3.6) | 2 | cmake_minimum_required(VERSION 3.6) |
| 3 | list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules") | 3 | list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules") |
| 4 | list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/externals/cmake-modules") | 4 | list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/externals/cmake-modules") |
| 5 | include(DownloadExternals) | ||
| 5 | 6 | ||
| 6 | project(citra) | 7 | project(citra) |
| 7 | 8 | ||
| @@ -12,6 +13,15 @@ option(ENABLE_QT "Enable the Qt frontend" ON) | |||
| 12 | option(CITRA_USE_BUNDLED_QT "Download bundled Qt binaries" OFF) | 13 | option(CITRA_USE_BUNDLED_QT "Download bundled Qt binaries" OFF) |
| 13 | 14 | ||
| 14 | option(ENABLE_WEB_SERVICE "Enable web services (telemetry, etc.)" ON) | 15 | option(ENABLE_WEB_SERVICE "Enable web services (telemetry, etc.)" ON) |
| 16 | option(CITRA_USE_BUNDLED_CURL "FOR MINGW ONLY: Download curl configured against winssl instead of openssl" OFF) | ||
| 17 | if (ENABLE_WEB_SERVICE AND CITRA_USE_BUNDLED_CURL AND WINDOWS AND MSVC) | ||
| 18 | message("Turning off use bundled curl as msvc can compile curl on cpr") | ||
| 19 | SET(CITRA_USE_BUNDLED_CURL OFF CACHE BOOL "" FORCE) | ||
| 20 | endif() | ||
| 21 | if (ENABLE_WEB_SERVICE AND NOT CITRA_USE_BUNDLED_CURL AND MINGW) | ||
| 22 | message(AUTHOR_WARNING "Turning on CITRA_USE_BUNDLED_CURL. Override it only if you know what you are doing.") | ||
| 23 | SET(CITRA_USE_BUNDLED_CURL ON CACHE BOOL "" FORCE) | ||
| 24 | endif() | ||
| 15 | 25 | ||
| 16 | if(NOT EXISTS ${CMAKE_SOURCE_DIR}/.git/hooks/pre-commit) | 26 | if(NOT EXISTS ${CMAKE_SOURCE_DIR}/.git/hooks/pre-commit) |
| 17 | message(STATUS "Copying pre-commit hook") | 27 | message(STATUS "Copying pre-commit hook") |
| @@ -151,24 +161,6 @@ set_property(DIRECTORY APPEND PROPERTY | |||
| 151 | # System imported libraries | 161 | # System imported libraries |
| 152 | # ====================== | 162 | # ====================== |
| 153 | 163 | ||
| 154 | # This function downloads a binary library package from our external repo. | ||
| 155 | # Params: | ||
| 156 | # remote_path: path to the file to download, relative to the remote repository root | ||
| 157 | # prefix_var: name of a variable which will be set with the path to the extracted contents | ||
| 158 | function(download_bundled_external remote_path lib_name prefix_var) | ||
| 159 | set(prefix "${CMAKE_BINARY_DIR}/externals/${lib_name}") | ||
| 160 | if (NOT EXISTS "${prefix}") | ||
| 161 | message(STATUS "Downloading binaries for ${lib_name}...") | ||
| 162 | file(DOWNLOAD | ||
| 163 | https://github.com/citra-emu/ext-windows-bin/raw/master/${remote_path}${lib_name}.7z | ||
| 164 | "${CMAKE_BINARY_DIR}/externals/${lib_name}.7z" SHOW_PROGRESS) | ||
| 165 | execute_process(COMMAND ${CMAKE_COMMAND} -E tar xf "${CMAKE_BINARY_DIR}/externals/${lib_name}.7z" | ||
| 166 | WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/externals") | ||
| 167 | endif() | ||
| 168 | message(STATUS "Using bundled binaries at ${prefix}") | ||
| 169 | set(${prefix_var} "${prefix}" PARENT_SCOPE) | ||
| 170 | endfunction() | ||
| 171 | |||
| 172 | find_package(PNG QUIET) | 164 | find_package(PNG QUIET) |
| 173 | if (NOT PNG_FOUND) | 165 | if (NOT PNG_FOUND) |
| 174 | message(STATUS "libpng not found. Some debugging features have been disabled.") | 166 | message(STATUS "libpng not found. Some debugging features have been disabled.") |
diff --git a/CMakeModules/DownloadExternals.cmake b/CMakeModules/DownloadExternals.cmake new file mode 100644 index 000000000..138a15d5a --- /dev/null +++ b/CMakeModules/DownloadExternals.cmake | |||
| @@ -0,0 +1,18 @@ | |||
| 1 | |||
| 2 | # This function downloads a binary library package from our external repo. | ||
| 3 | # Params: | ||
| 4 | # remote_path: path to the file to download, relative to the remote repository root | ||
| 5 | # prefix_var: name of a variable which will be set with the path to the extracted contents | ||
| 6 | function(download_bundled_external remote_path lib_name prefix_var) | ||
| 7 | set(prefix "${CMAKE_BINARY_DIR}/externals/${lib_name}") | ||
| 8 | if (NOT EXISTS "${prefix}") | ||
| 9 | message(STATUS "Downloading binaries for ${lib_name}...") | ||
| 10 | file(DOWNLOAD | ||
| 11 | https://github.com/citra-emu/ext-windows-bin/raw/master/${remote_path}${lib_name}.7z | ||
| 12 | "${CMAKE_BINARY_DIR}/externals/${lib_name}.7z" SHOW_PROGRESS) | ||
| 13 | execute_process(COMMAND ${CMAKE_COMMAND} -E tar xf "${CMAKE_BINARY_DIR}/externals/${lib_name}.7z" | ||
| 14 | WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/externals") | ||
| 15 | endif() | ||
| 16 | message(STATUS "Using bundled binaries at ${prefix}") | ||
| 17 | set(${prefix_var} "${prefix}" PARENT_SCOPE) | ||
| 18 | endfunction() \ No newline at end of file | ||
diff --git a/appveyor.yml b/appveyor.yml index ec9ca3747..5524eb576 100644 --- a/appveyor.yml +++ b/appveyor.yml | |||
| @@ -44,7 +44,7 @@ before_build: | |||
| 44 | # redirect stderr and change the exit code to prevent powershell from cancelling the build if cmake prints a warning | 44 | # redirect stderr and change the exit code to prevent powershell from cancelling the build if cmake prints a warning |
| 45 | cmd /C 'cmake -G "Visual Studio 15 2017 Win64" -DCITRA_USE_BUNDLED_QT=1 -DCITRA_USE_BUNDLED_SDL2=1 -DCMAKE_USE_OPENSSL=0 .. 2>&1 && exit 0' | 45 | cmd /C 'cmake -G "Visual Studio 15 2017 Win64" -DCITRA_USE_BUNDLED_QT=1 -DCITRA_USE_BUNDLED_SDL2=1 -DCMAKE_USE_OPENSSL=0 .. 2>&1 && exit 0' |
| 46 | } else { | 46 | } else { |
| 47 | C:\msys64\usr\bin\bash.exe -lc "cmake -G 'MSYS Makefiles' -DUSE_SYSTEM_CURL=1 -DCMAKE_BUILD_TYPE=Release .. 2>&1" | 47 | C:\msys64\usr\bin\bash.exe -lc "cmake -G 'MSYS Makefiles' -DUSE_SYSTEM_CURL=1 -DCITRA_USE_BUNDLED_CURL=1 -DCMAKE_BUILD_TYPE=Release .. 2>&1" |
| 48 | } | 48 | } |
| 49 | - cd .. | 49 | - cd .. |
| 50 | 50 | ||
| @@ -112,9 +112,10 @@ after_build: | |||
| 112 | 112 | ||
| 113 | # copy the compiled binaries and other release files to the release folder | 113 | # copy the compiled binaries and other release files to the release folder |
| 114 | Get-ChildItem "$CMAKE_BINARY_DIR" -Recurse -Filter "citra*.exe" | Copy-Item -destination $RELEASE_DIST | 114 | Get-ChildItem "$CMAKE_BINARY_DIR" -Recurse -Filter "citra*.exe" | Copy-Item -destination $RELEASE_DIST |
| 115 | # copy the libcurl dll | ||
| 116 | Get-ChildItem "$CMAKE_BINARY_DIR" -Recurse -Filter "libcurl.dll" | Copy-Item -destination $RELEASE_DIST | ||
| 115 | Copy-Item -path "$CMAKE_SOURCE_DIR/license.txt" -destination $RELEASE_DIST | 117 | Copy-Item -path "$CMAKE_SOURCE_DIR/license.txt" -destination $RELEASE_DIST |
| 116 | Copy-Item -path "$CMAKE_SOURCE_DIR/README.md" -destination $RELEASE_DIST | 118 | Copy-Item -path "$CMAKE_SOURCE_DIR/README.md" -destination $RELEASE_DIST |
| 117 | |||
| 118 | # copy all the dll dependencies to the release folder | 119 | # copy all the dll dependencies to the release folder |
| 119 | # hardcoded list because we don't build static and determining the list of dlls from the binary is a pain. | 120 | # hardcoded list because we don't build static and determining the list of dlls from the binary is a pain. |
| 120 | $MingwDLLs = "Qt5Core.dll","Qt5Widgets.dll","Qt5Gui.dll","Qt5OpenGL.dll", | 121 | $MingwDLLs = "Qt5Core.dll","Qt5Widgets.dll","Qt5Gui.dll","Qt5OpenGL.dll", |
| @@ -123,11 +124,7 @@ after_build: | |||
| 123 | "libfreetype-*.dll","libglib-*.dll","libgobject-*.dll","libgraphite2.dll","libiconv-*.dll", | 124 | "libfreetype-*.dll","libglib-*.dll","libgobject-*.dll","libgraphite2.dll","libiconv-*.dll", |
| 124 | "libharfbuzz-*.dll","libintl-*.dll","libpcre-*.dll","libpcre16-*.dll","libpng16-*.dll", | 125 | "libharfbuzz-*.dll","libintl-*.dll","libpcre-*.dll","libpcre16-*.dll","libpng16-*.dll", |
| 125 | # Runtime/Other dependencies | 126 | # Runtime/Other dependencies |
| 126 | "libgcc_s_seh-*.dll","libstdc++-*.dll","libwinpthread-*.dll","SDL2.dll","zlib1.dll", | 127 | "libgcc_s_seh-*.dll","libstdc++-*.dll","libwinpthread-*.dll","SDL2.dll","zlib1.dll" |
| 127 | # curl dependencies | ||
| 128 | "libcurl-*.dll","libnghttp2-*.dll","libeay32.dll","libgmp-*.dll","librtmp-*.dll", | ||
| 129 | "libgnutls-*.dll","libhogweed-*.dll","libnettle-*.dll","libssh2-*.dll", | ||
| 130 | "ssleay32.dll","libidn-*.dll","libp11-kit-*.dll","libtasn1-*.dll","libunistring-*.dll" | ||
| 131 | foreach ($file in $MingwDLLs) { | 128 | foreach ($file in $MingwDLLs) { |
| 132 | Copy-Item -path "C:/msys64/mingw64/bin/$file" -force -destination "$RELEASE_DIST" | 129 | Copy-Item -path "C:/msys64/mingw64/bin/$file" -force -destination "$RELEASE_DIST" |
| 133 | } | 130 | } |
diff --git a/externals/CMakeLists.txt b/externals/CMakeLists.txt index 8e4bcf21f..4a4ba1101 100644 --- a/externals/CMakeLists.txt +++ b/externals/CMakeLists.txt | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | # Definitions for all external bundled libraries | 1 | # Definitions for all external bundled libraries |
| 2 | 2 | ||
| 3 | set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/CMakeModules) | ||
| 4 | include(DownloadExternals) | ||
| 5 | |||
| 3 | # Catch | 6 | # Catch |
| 4 | add_library(catch-single-include INTERFACE) | 7 | add_library(catch-single-include INTERFACE) |
| 5 | target_include_directories(catch-single-include INTERFACE catch/single_include) | 8 | target_include_directories(catch-single-include INTERFACE catch/single_include) |
| @@ -54,9 +57,21 @@ add_subdirectory(enet) | |||
| 54 | target_include_directories(enet INTERFACE ./enet/include) | 57 | target_include_directories(enet INTERFACE ./enet/include) |
| 55 | 58 | ||
| 56 | if (ENABLE_WEB_SERVICE) | 59 | if (ENABLE_WEB_SERVICE) |
| 60 | # msys installed curl is configured to use openssl, but that isn't portable | ||
| 61 | # since it relies on having the bundled certs install in the home folder for SSL | ||
| 62 | # by default on mingw, download the precompiled curl thats linked against windows native ssl | ||
| 63 | if (MINGW AND CITRA_USE_BUNDLED_CURL) | ||
| 64 | download_bundled_external("curl/" "curl-7_55_1" CURL_PREFIX) | ||
| 65 | set(CURL_PREFIX "${CMAKE_BINARY_DIR}/externals/curl-7_55_1") | ||
| 66 | set(CURL_FOUND YES) | ||
| 67 | set(CURL_INCLUDE_DIR "${CURL_PREFIX}/include" CACHE PATH "Path to curl headers") | ||
| 68 | set(CURL_LIBRARY "${CURL_PREFIX}/lib/libcurldll.a" CACHE PATH "Path to curl library") | ||
| 69 | set(CURL_DLL_DIR "${CURL_PREFIX}/lib/" CACHE PATH "Path to curl.dll") | ||
| 70 | set(USE_SYSTEM_CURL ON CACHE BOOL "") | ||
| 71 | endif() | ||
| 57 | # CPR | 72 | # CPR |
| 58 | option(BUILD_TESTING OFF) | 73 | set(BUILD_TESTING OFF CACHE BOOL "") |
| 59 | option(BUILD_CPR_TESTS OFF) | 74 | set(BUILD_CPR_TESTS OFF CACHE BOOL "") |
| 60 | add_subdirectory(cpr) | 75 | add_subdirectory(cpr) |
| 61 | target_include_directories(cpr INTERFACE ./cpr/include) | 76 | target_include_directories(cpr INTERFACE ./cpr/include) |
| 62 | 77 | ||