From 1e1ba4e0c2096040e34e21f96364067390466c13 Mon Sep 17 00:00:00 2001 From: Alexandre Bouvier Date: Mon, 29 Jan 2024 22:40:57 +0100 Subject: [PATCH] cmake: prefer system oaknut --- CMakeLists.txt | 19 ++++++++++++------- CMakeModules/dynarmicConfig.cmake.in | 4 ++-- externals/CMakeLists.txt | 6 +++++- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e1ed7ff1..7274e664 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -133,28 +133,33 @@ if (DYNARMIC_USE_BUNDLED_EXTERNALS) set(CMAKE_DISABLE_FIND_PACKAGE_Catch2 ON) set(CMAKE_DISABLE_FIND_PACKAGE_fmt ON) set(CMAKE_DISABLE_FIND_PACKAGE_mcl ON) + set(CMAKE_DISABLE_FIND_PACKAGE_oaknut 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 QUIET) -find_package(mcl 0.1.12 EXACT QUIET) -find_package(tsl-robin-map QUIET) +find_package(fmt 9 CONFIG) +find_package(mcl 0.1.12 EXACT CONFIG) +find_package(tsl-robin-map CONFIG) + +if ("arm64" IN_LIST ARCHITECTURE OR DYNARMIC_TESTS) + find_package(oaknut 2.0.1 CONFIG) +endif() if ("x86_64" IN_LIST ARCHITECTURE) - find_package(xbyak 6 QUIET) - find_package(Zydis 4 QUIET) + find_package(xbyak 6 CONFIG) + find_package(Zydis 4 CONFIG) endif() if (DYNARMIC_USE_LLVM) - find_package(LLVM REQUIRED CONFIG) + find_package(LLVM REQUIRED) separate_arguments(LLVM_DEFINITIONS) endif() if (DYNARMIC_TESTS) - find_package(Catch2 3 QUIET) + find_package(Catch2 3 CONFIG) if (DYNARMIC_TESTS_USE_UNICORN) find_package(Unicorn REQUIRED) endif() diff --git a/CMakeModules/dynarmicConfig.cmake.in b/CMakeModules/dynarmicConfig.cmake.in index fdd7017e..9a7d020b 100644 --- a/CMakeModules/dynarmicConfig.cmake.in +++ b/CMakeModules/dynarmicConfig.cmake.in @@ -11,7 +11,7 @@ if (NOT @BUILD_SHARED_LIBS@) find_dependency(tsl-robin-map) if ("arm64" IN_LIST ARCHITECTURE) - find_dependency(oaknut) + find_dependency(oaknut 2.0.1) endif() if ("x86_64" IN_LIST ARCHITECTURE) @@ -20,7 +20,7 @@ if (NOT @BUILD_SHARED_LIBS@) endif() if (@DYNARMIC_USE_LLVM@) - find_dependency(LLVM CONFIG) + find_dependency(LLVM) endif() endif() diff --git a/externals/CMakeLists.txt b/externals/CMakeLists.txt index 72e90f3b..129d6a41 100644 --- a/externals/CMakeLists.txt +++ b/externals/CMakeLists.txt @@ -41,7 +41,11 @@ endif() # oaknut if (NOT TARGET merry::oaknut) - add_subdirectory(oaknut) + if ("arm64" IN_LIST ARCHITECTURE) + add_subdirectory(oaknut) + elseif (DYNARMIC_TESTS) + add_subdirectory(oaknut EXCLUDE_FROM_ALL) + endif() endif() # robin-map