summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt77
1 files changed, 0 insertions, 77 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1bd9d2aa7..8fc2de042 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -18,8 +18,6 @@ CMAKE_DEPENDENT_OPTION(YUZU_USE_BUNDLED_QT "Download bundled Qt binaries" ON "EN
18 18
19option(ENABLE_WEB_SERVICE "Enable web services (telemetry, etc.)" ON) 19option(ENABLE_WEB_SERVICE "Enable web services (telemetry, etc.)" ON)
20 20
21option(YUZU_USE_BUNDLED_UNICORN "Build/Download bundled Unicorn" ON)
22
23option(YUZU_USE_QT_WEB_ENGINE "Use QtWebEngine for web applet implementation" OFF) 21option(YUZU_USE_QT_WEB_ENGINE "Use QtWebEngine for web applet implementation" OFF)
24 22
25option(YUZU_ENABLE_BOXCAT "Enable the Boxcat service, a yuzu high-level implementation of BCAT" ON) 23option(YUZU_ENABLE_BOXCAT "Enable the Boxcat service, a yuzu high-level implementation of BCAT" ON)
@@ -372,81 +370,6 @@ endif()
372set(THREADS_PREFER_PTHREAD_FLAG ON) 370set(THREADS_PREFER_PTHREAD_FLAG ON)
373find_package(Threads REQUIRED) 371find_package(Threads REQUIRED)
374 372
375# If unicorn isn't found, msvc -> download bundled unicorn; everyone else -> build external
376if (YUZU_USE_BUNDLED_UNICORN)
377 if (MSVC)
378 message(STATUS "unicorn not found, falling back to bundled")
379 # Detect toolchain and platform
380 if ((MSVC_VERSION GREATER_EQUAL 1910 AND MSVC_VERSION LESS 1930) AND ARCHITECTURE_x86_64)
381 set(UNICORN_VER "unicorn-yuzu")
382 else()
383 message(FATAL_ERROR "No bundled Unicorn binaries for your toolchain. Disable YUZU_USE_BUNDLED_UNICORN and provide your own.")
384 endif()
385
386 if (DEFINED UNICORN_VER)
387 download_bundled_external("unicorn/" ${UNICORN_VER} UNICORN_PREFIX)
388 endif()
389
390 if (DEFINED UNICORN_VER)
391 download_bundled_external("unicorn/" ${UNICORN_VER} UNICORN_PREFIX)
392 endif()
393
394 set(UNICORN_FOUND YES)
395 set(LIBUNICORN_INCLUDE_DIR "${UNICORN_PREFIX}/include" CACHE PATH "Path to Unicorn headers" FORCE)
396 set(LIBUNICORN_LIBRARY "${UNICORN_PREFIX}/lib/x64/unicorn_dynload.lib" CACHE PATH "Path to Unicorn library" FORCE)
397 set(UNICORN_DLL_DIR "${UNICORN_PREFIX}/lib/x64/" CACHE PATH "Path to unicorn.dll" FORCE)
398 else()
399 message(STATUS "unicorn not found, falling back to externals")
400 if (MINGW)
401 set(UNICORN_LIB_NAME "unicorn.a")
402 else()
403 set(UNICORN_LIB_NAME "libunicorn.a")
404 endif()
405
406 set(UNICORN_FOUND YES)
407 set(UNICORN_PREFIX ${PROJECT_SOURCE_DIR}/externals/unicorn)
408 set(LIBUNICORN_LIBRARY "${UNICORN_PREFIX}/${UNICORN_LIB_NAME}" CACHE PATH "Path to Unicorn library" FORCE)
409 set(LIBUNICORN_INCLUDE_DIR "${UNICORN_PREFIX}/include" CACHE PATH "Path to Unicorn headers" FORCE)
410 set(UNICORN_DLL_DIR "${UNICORN_PREFIX}/" CACHE PATH "Path to unicorn dynamic library" FORCE)
411
412 find_package(PythonInterp 2.7 REQUIRED)
413
414 if (MINGW)
415 # Intentionally call the unicorn makefile directly instead of using make.sh so that we can override the
416 # UNAME_S makefile variable to MINGW. This way we don't have to hack at the uname binary to build
417 # Additionally, overriding DO_WINDOWS_EXPORT prevents unicorn from patching the static unicorn.a by using msvc and cmd,
418 # which are both things we don't have in a mingw cross compiling environment.
419 add_custom_command(OUTPUT ${LIBUNICORN_LIBRARY}
420 COMMAND ${CMAKE_COMMAND} -E env UNICORN_ARCHS="aarch64" PYTHON="${PYTHON_EXECUTABLE}" CC=x86_64-w64-mingw32-gcc AR=x86_64-w64-mingw32-gcc-ar RANLIB=x86_64-w64-mingw32-gcc-ranlib make UNAME_S=MINGW DO_WINDOWS_EXPORT=0
421 WORKING_DIRECTORY ${UNICORN_PREFIX}
422 )
423 else()
424 add_custom_command(OUTPUT ${LIBUNICORN_LIBRARY}
425 COMMAND ${CMAKE_COMMAND} -E env UNICORN_ARCHS="aarch64" PYTHON="${PYTHON_EXECUTABLE}" /bin/sh make.sh macos-universal-no
426 WORKING_DIRECTORY ${UNICORN_PREFIX}
427 )
428 endif()
429
430 # ALL makes this custom target build every time
431 # but it won't actually build if LIBUNICORN_LIBRARY is up to date
432 add_custom_target(unicorn-build ALL
433 DEPENDS ${LIBUNICORN_LIBRARY}
434 )
435 unset(UNICORN_LIB_NAME)
436 endif()
437else()
438 find_package(Unicorn REQUIRED)
439endif()
440
441if (UNICORN_FOUND)
442 add_library(unicorn INTERFACE)
443 add_dependencies(unicorn unicorn-build)
444 target_link_libraries(unicorn INTERFACE "${LIBUNICORN_LIBRARY}")
445 target_include_directories(unicorn INTERFACE "${LIBUNICORN_INCLUDE_DIR}")
446else()
447 message(FATAL_ERROR "Could not find or build unicorn which is required.")
448endif()
449
450# Platform-specific library requirements 373# Platform-specific library requirements
451# ====================================== 374# ======================================
452 375