cmake: prefer system oaknut

This commit is contained in:
Alexandre Bouvier 2024-01-29 22:40:57 +01:00 committed by merry
parent 2ee3eacd01
commit 1e1ba4e0c2
3 changed files with 19 additions and 10 deletions

View file

@ -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()

View file

@ -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()

View file

@ -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