diff options
| author | 2018-01-16 11:56:14 -0500 | |
|---|---|---|
| committer | 2018-01-16 11:56:14 -0500 | |
| commit | f53dc4c9d6ab7ae8e90d7375ef76935ffbea93a1 (patch) | |
| tree | 16416d266d5467e7cb5fdb5e8c88ad317dd54b3f /CMakeLists.txt | |
| parent | Implement Pull #3333 from citra: citra_qt: Pause emulation on CoreError (#39) (diff) | |
| parent | Build: Automagically handle unicorn (diff) | |
| download | yuzu-f53dc4c9d6ab7ae8e90d7375ef76935ffbea93a1.tar.gz yuzu-f53dc4c9d6ab7ae8e90d7375ef76935ffbea93a1.tar.xz yuzu-f53dc4c9d6ab7ae8e90d7375ef76935ffbea93a1.zip | |
Merge pull request #31 from jroweboy/fix-deploy
Build/Deploy Updates to Setup Nightly Builds
Diffstat (limited to 'CMakeLists.txt')
| -rw-r--r-- | CMakeLists.txt | 71 |
1 files changed, 49 insertions, 22 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 3da8465b9..2ec9467e5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
| @@ -12,8 +12,6 @@ option(YUZU_USE_BUNDLED_SDL2 "Download bundled SDL2 binaries" OFF) | |||
| 12 | option(ENABLE_QT "Enable the Qt frontend" ON) | 12 | option(ENABLE_QT "Enable the Qt frontend" ON) |
| 13 | option(YUZU_USE_BUNDLED_QT "Download bundled Qt binaries" OFF) | 13 | option(YUZU_USE_BUNDLED_QT "Download bundled Qt binaries" OFF) |
| 14 | 14 | ||
| 15 | option(YUZU_USE_BUNDLED_UNICORN "Download bundled Unicorn binaries" OFF) | ||
| 16 | |||
| 17 | if(NOT EXISTS ${CMAKE_SOURCE_DIR}/.git/hooks/pre-commit) | 15 | if(NOT EXISTS ${CMAKE_SOURCE_DIR}/.git/hooks/pre-commit) |
| 18 | message(STATUS "Copying pre-commit hook") | 16 | message(STATUS "Copying pre-commit hook") |
| 19 | file(COPY hooks/pre-commit | 17 | file(COPY hooks/pre-commit |
| @@ -29,7 +27,7 @@ function(check_submodules_present) | |||
| 29 | foreach(module ${gitmodules}) | 27 | foreach(module ${gitmodules}) |
| 30 | string(REGEX REPLACE "path *= *" "" module ${module}) | 28 | string(REGEX REPLACE "path *= *" "" module ${module}) |
| 31 | if (NOT EXISTS "${CMAKE_SOURCE_DIR}/${module}/.git") | 29 | if (NOT EXISTS "${CMAKE_SOURCE_DIR}/${module}/.git") |
| 32 | message(SEND_ERROR "Git submodule ${module} not found." | 30 | message(FATAL_ERROR "Git submodule ${module} not found. " |
| 33 | "Please run: git submodule update --init --recursive") | 31 | "Please run: git submodule update --init --recursive") |
| 34 | endif() | 32 | endif() |
| 35 | endforeach() | 33 | endforeach() |
| @@ -204,34 +202,63 @@ else() | |||
| 204 | set(SDL2_FOUND NO) | 202 | set(SDL2_FOUND NO) |
| 205 | endif() | 203 | endif() |
| 206 | 204 | ||
| 207 | if (YUZU_USE_BUNDLED_UNICORN) | 205 | # If unicorn isn't found, msvc -> download bundled unicorn; everyone else -> build external |
| 208 | # Detect toolchain and platform | 206 | find_package(Unicorn QUIET) |
| 209 | if (MSVC14 AND ARCHITECTURE_x86_64) | 207 | if (NOT UNICORN_FOUND) |
| 210 | set(UNICORN_VER "unicorn-yuzu") | 208 | if (MSVC) |
| 211 | else() | 209 | message(STATUS "unicorn not found, falling back to bundled") |
| 212 | message(FATAL_ERROR "No bundled Unicorn binaries for your toolchain. Disable YUZU_USE_BUNDLED_UNICORN and provide your own.") | 210 | # Detect toolchain and platform |
| 213 | endif() | 211 | if (MSVC14 AND ARCHITECTURE_x86_64) |
| 212 | set(UNICORN_VER "unicorn-yuzu") | ||
| 213 | else() | ||
| 214 | message(FATAL_ERROR "No bundled Unicorn binaries for your toolchain. Disable YUZU_USE_BUNDLED_UNICORN and provide your own.") | ||
| 215 | endif() | ||
| 214 | 216 | ||
| 215 | if (DEFINED UNICORN_VER) | 217 | if (DEFINED UNICORN_VER) |
| 216 | download_bundled_external("unicorn/" ${UNICORN_VER} UNICORN_PREFIX) | 218 | download_bundled_external("unicorn/" ${UNICORN_VER} UNICORN_PREFIX) |
| 217 | endif() | 219 | endif() |
| 218 | 220 | ||
| 219 | if (DEFINED UNICORN_VER) | 221 | if (DEFINED UNICORN_VER) |
| 220 | download_bundled_external("unicorn/" ${UNICORN_VER} UNICORN_PREFIX) | 222 | download_bundled_external("unicorn/" ${UNICORN_VER} UNICORN_PREFIX) |
| 221 | endif() | 223 | endif() |
| 222 | 224 | ||
| 223 | set(UNICORN_FOUND YES) | 225 | set(UNICORN_FOUND YES) |
| 224 | set(LIBUNICORN_INCLUDE_DIR "${UNICORN_PREFIX}/include" CACHE PATH "Path to Unicorn headers") | 226 | set(LIBUNICORN_INCLUDE_DIR "${UNICORN_PREFIX}/include" CACHE PATH "Path to Unicorn headers" FORCE) |
| 225 | set(LIBUNICORN_LIBRARY "${UNICORN_PREFIX}/lib/x64/unicorn_dynload.lib" CACHE PATH "Path to Unicorn library") | 227 | set(LIBUNICORN_LIBRARY "${UNICORN_PREFIX}/lib/x64/unicorn_dynload.lib" CACHE PATH "Path to Unicorn library" FORCE) |
| 226 | set(UNICORN_DLL_DIR "${UNICORN_PREFIX}/lib/x64/" CACHE PATH "Path to unicorn.dll") | 228 | set(UNICORN_DLL_DIR "${UNICORN_PREFIX}/lib/x64/" CACHE PATH "Path to unicorn.dll" FORCE) |
| 227 | else() | 229 | else() |
| 228 | find_package(Unicorn REQUIRED) | 230 | message(STATUS "unicorn not found, falling back to externals") |
| 231 | if (MINGW) | ||
| 232 | set(UNICORN_LIB_NAME "unicorn.a") | ||
| 233 | else() | ||
| 234 | set(UNICORN_LIB_NAME "libunicorn.a") | ||
| 235 | endif() | ||
| 236 | |||
| 237 | set(UNICORN_FOUND YES) | ||
| 238 | set(UNICORN_PREFIX ${CMAKE_SOURCE_DIR}/externals/unicorn) | ||
| 239 | set(LIBUNICORN_LIBRARY "${UNICORN_PREFIX}/${UNICORN_LIB_NAME}" CACHE PATH "Path to Unicorn library" FORCE) | ||
| 240 | set(LIBUNICORN_INCLUDE_DIR "${UNICORN_PREFIX}/include" CACHE PATH "Path to Unicorn headers" FORCE) | ||
| 241 | set(UNICORN_DLL_DIR "${UNICORN_PREFIX}/" CACHE PATH "Path to unicorn dynamic library" FORCE) | ||
| 242 | |||
| 243 | add_custom_command(OUTPUT ${LIBUNICORN_LIBRARY} | ||
| 244 | COMMAND ${CMAKE_COMMAND} -E env UNICORN_ARCHS="aarch64" /bin/sh make.sh | ||
| 245 | WORKING_DIRECTORY ${UNICORN_PREFIX} | ||
| 246 | ) | ||
| 247 | # ALL makes this custom target build every time | ||
| 248 | # but it won't actually build if LIBUNICORN_LIBRARY is up to date | ||
| 249 | add_custom_target(unicorn-build ALL | ||
| 250 | DEPENDS ${LIBUNICORN_LIBRARY} | ||
| 251 | ) | ||
| 252 | unset(UNICORN_LIB_NAME) | ||
| 253 | endif() | ||
| 229 | endif() | 254 | endif() |
| 230 | 255 | ||
| 231 | if (UNICORN_FOUND) | 256 | if (UNICORN_FOUND) |
| 232 | add_library(unicorn INTERFACE) | 257 | add_library(unicorn INTERFACE) |
| 233 | target_link_libraries(unicorn INTERFACE "${LIBUNICORN_LIBRARY}") | 258 | target_link_libraries(unicorn INTERFACE "${LIBUNICORN_LIBRARY}") |
| 234 | target_include_directories(unicorn INTERFACE "${LIBUNICORN_INCLUDE_DIR}") | 259 | target_include_directories(unicorn INTERFACE "${LIBUNICORN_INCLUDE_DIR}") |
| 260 | else() | ||
| 261 | message(FATAL_ERROR "Could not find or build unicorn which is required.") | ||
| 235 | endif() | 262 | endif() |
| 236 | 263 | ||
| 237 | if (ENABLE_QT) | 264 | if (ENABLE_QT) |