diff options
Diffstat (limited to 'CMakeLists.txt')
| -rw-r--r-- | CMakeLists.txt | 32 |
1 files changed, 12 insertions, 20 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index ddba04ef9..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") |
| @@ -129,8 +139,8 @@ else() | |||
| 129 | set(CMAKE_C_FLAGS_RELEASE "/O2 /GS- /MD" CACHE STRING "" FORCE) | 139 | set(CMAKE_C_FLAGS_RELEASE "/O2 /GS- /MD" CACHE STRING "" FORCE) |
| 130 | set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}" CACHE STRING "" FORCE) | 140 | set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}" CACHE STRING "" FORCE) |
| 131 | 141 | ||
| 132 | set(CMAKE_EXE_LINKER_FLAGS_DEBUG "/DEBUG" CACHE STRING "" FORCE) | 142 | set(CMAKE_EXE_LINKER_FLAGS_DEBUG "/DEBUG /MANIFEST:NO" CACHE STRING "" FORCE) |
| 133 | set(CMAKE_EXE_LINKER_FLAGS_RELEASE "/DEBUG /INCREMENTAL:NO /OPT:REF,ICF" CACHE STRING "" FORCE) | 143 | set(CMAKE_EXE_LINKER_FLAGS_RELEASE "/DEBUG /MANIFEST:NO /INCREMENTAL:NO /OPT:REF,ICF" CACHE STRING "" FORCE) |
| 134 | endif() | 144 | endif() |
| 135 | 145 | ||
| 136 | # Set file offset size to 64 bits. | 146 | # Set file offset size to 64 bits. |
| @@ -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.") |