aboutsummaryrefslogtreecommitdiffhomepage
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorMerry <[email protected]>2022-11-30 00:28:48 +0000
committerMerry <[email protected]>2022-11-30 00:28:48 +0000
commit8f9838e9b03a8bdcc2858e24873c4a06f94de01e (patch)
tree3cf8dd83e9321cc8f4642c3abab27f24a217a300 /CMakeLists.txt
parent5e1f305542823d0a04dbd8a71e68b905a698c166 (diff)
downloaddynarmic-8f9838e9b03a8bdcc2858e24873c4a06f94de01e.tar.gz
dynarmic-8f9838e9b03a8bdcc2858e24873c4a06f94de01e.zip
CMakeLists: Add DYNARMIC_USE_BUNDLED_EXTERNALS to enable bundling with one flag
Convenience.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt27
1 files changed, 17 insertions, 10 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b896d910..3fb28190 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -17,6 +17,7 @@ option(DYNARMIC_TESTS "Build tests" ${MASTER_PROJECT})
option(DYNARMIC_TESTS_USE_UNICORN "Enable fuzzing tests against unicorn" OFF)
option(DYNARMIC_USE_LLVM "Support disassembly of jitted x86_64 code using LLVM" OFF)
option(DYNARMIC_USE_PRECOMPILED_HEADERS "Use precompiled headers" ON)
+option(DYNARMIC_USE_BUNDLED_EXTERNALS "Use all bundled externals (useful when e.g. cross-compiling)" OFF)
option(DYNARMIC_WARNINGS_AS_ERRORS "Warnings as errors" ${MASTER_PROJECT})
if (NOT DEFINED DYNARMIC_FRONTENDS)
set(DYNARMIC_FRONTENDS "A32;A64" CACHE STRING "Selects which frontends to enable")
@@ -113,20 +114,25 @@ if (NOT DEFINED ARCHITECTURE)
endif()
message(STATUS "Target architecture: ${ARCHITECTURE}")
-# Forced use of external for non-REQUIRED library is possible with e.g. cmake -DCMAKE_DISABLE_FIND_PACKAGE_fmt=ON ...
+# Forced use of individual bundled libraries for non-REQUIRED library is possible with e.g. cmake -DCMAKE_DISABLE_FIND_PACKAGE_fmt=ON ...
+
+if (DYNARMIC_USE_BUNDLED_EXTERNALS)
+ set(CMAKE_DISABLE_FIND_PACKAGE_Catch2 ON)
+ set(CMAKE_DISABLE_FIND_PACKAGE_fmt ON)
+ set(CMAKE_DISABLE_FIND_PACKAGE_tsl-robin-map ON)
+ set(CMAKE_DISABLE_FIND_PACKAGE_xbyak ON)
+ set(CMAKE_DISABLE_FIND_PACKAGE_Zydis ON)
+endif()
+
find_package(Boost 1.57 REQUIRED)
-find_package(fmt 9)
-find_package(tsl-robin-map)
+find_package(fmt 9 QUIET)
+find_package(tsl-robin-map QUIET)
if (ARCHITECTURE STREQUAL "x86" OR ARCHITECTURE STREQUAL "x86_64")
- find_package(xbyak 6)
- find_package(Zydis 4)
+ find_package(xbyak 6 QUIET)
+ find_package(Zydis 4 QUIET)
endif()
-# Enable unit-testing.
-enable_testing(true)
-
-# Include LLVM
if (DYNARMIC_USE_LLVM)
find_package(LLVM REQUIRED CONFIG)
include_directories(${LLVM_INCLUDE_DIRS})
@@ -135,7 +141,7 @@ if (DYNARMIC_USE_LLVM)
endif()
if (DYNARMIC_TESTS)
- find_package(Catch2 2)
+ find_package(Catch2 2 QUIET)
if (DYNARMIC_TESTS_USE_UNICORN)
find_package(Unicorn REQUIRED)
endif()
@@ -147,6 +153,7 @@ add_subdirectory(externals)
# Dynarmic project files
add_subdirectory(src/dynarmic)
if (DYNARMIC_TESTS)
+ enable_testing(true)
add_subdirectory(tests)
endif()