summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorJames Rowe <jroweboy@gmail.com>2018-01-16 04:53:53 +0100
committerJames Rowe <jroweboy@gmail.com>2018-01-16 09:15:52 +0100
commite026b66bbbb78f3c43c067eb94675d4782fb70b6 (patch)
treed64dd737b71c7845c92b598c3e2aee4314343537 /CMakeLists.txt
parentMerge pull request #25 from chris062689/master (diff)
downloadyuzu-e026b66bbbb78f3c43c067eb94675d4782fb70b6.tar
yuzu-e026b66bbbb78f3c43c067eb94675d4782fb70b6.tar.gz
yuzu-e026b66bbbb78f3c43c067eb94675d4782fb70b6.tar.bz2
yuzu-e026b66bbbb78f3c43c067eb94675d4782fb70b6.tar.lz
yuzu-e026b66bbbb78f3c43c067eb94675d4782fb70b6.tar.xz
yuzu-e026b66bbbb78f3c43c067eb94675d4782fb70b6.tar.zst
yuzu-e026b66bbbb78f3c43c067eb94675d4782fb70b6.zip
Diffstat (limited to '')
-rw-r--r--CMakeLists.txt25
1 files changed, 25 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3da8465b9..f1a4d0152 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -224,6 +224,31 @@ if (YUZU_USE_BUNDLED_UNICORN)
set(LIBUNICORN_INCLUDE_DIR "${UNICORN_PREFIX}/include" CACHE PATH "Path to Unicorn headers")
set(LIBUNICORN_LIBRARY "${UNICORN_PREFIX}/lib/x64/unicorn_dynload.lib" CACHE PATH "Path to Unicorn library")
set(UNICORN_DLL_DIR "${UNICORN_PREFIX}/lib/x64/" CACHE PATH "Path to unicorn.dll")
+elseif (YUZU_BUILD_UNICORN)
+ if (MSVC)
+ message(FATAL_ERROR "Cannot build unicorn on msvc. Use YUZU_USE_BUNDLED_UNICORN instead")
+ elseif (MINGW)
+ set(UNICORN_LIB_NAME "unicorn.a")
+ else()
+ set(UNICORN_LIB_NAME "libunicorn.a")
+ endif()
+
+ set(UNICORN_FOUND YES)
+ set(UNICORN_PREFIX ${CMAKE_SOURCE_DIR}/externals/unicorn)
+ set(LIBUNICORN_LIBRARY "${UNICORN_PREFIX}/${UNICORN_LIB_NAME}" CACHE PATH "Path to Unicorn library")
+ set(LIBUNICORN_INCLUDE_DIR "${UNICORN_PREFIX}/include" CACHE PATH "Path to Unicorn headers")
+ set(UNICORN_DLL_DIR "${UNICORN_PREFIX}/" CACHE PATH "Path to unicorn dynamic library")
+
+ add_custom_command(OUTPUT ${LIBUNICORN_LIBRARY}
+ COMMAND ${CMAKE_COMMAND} -E env UNICORN_ARCHS="aarch64" /bin/sh make.sh
+ WORKING_DIRECTORY ${UNICORN_PREFIX}
+ )
+ # ALL makes this custom target build every time
+ # but it won't actually build if LIBUNICORN_LIBRARY exists
+ add_custom_target(unicorn-build ALL
+ DEPENDS ${LIBUNICORN_LIBRARY}
+ )
+ unset(UNICORN_LIB_NAME)
else()
find_package(Unicorn REQUIRED)
endif()