2022-01-06 04:24:09 +00:00
|
|
|
# Always build externals as static libraries, even when dynarmic is built as shared
|
2022-04-23 18:47:35 +01:00
|
|
|
if (BUILD_SHARED_LIBS)
|
|
|
|
set(BUILD_SHARED_LIBS OFF)
|
|
|
|
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
|
|
|
endif()
|
2022-01-06 04:24:09 +00:00
|
|
|
|
2016-08-25 22:21:19 +01:00
|
|
|
# For libraries that already come with a CMakeLists file,
|
|
|
|
# simply add the directory to that file as a subdirectory
|
|
|
|
# to have CMake automatically recognize them.
|
|
|
|
|
2020-05-21 21:31:18 +01:00
|
|
|
# catch
|
|
|
|
|
2021-08-10 15:05:38 +01:00
|
|
|
if (DYNARMIC_TESTS AND NOT TARGET catch)
|
|
|
|
add_library(catch INTERFACE)
|
|
|
|
target_include_directories(catch INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/catch/include>)
|
|
|
|
endif()
|
2020-05-21 21:31:18 +01:00
|
|
|
|
|
|
|
# fmt
|
|
|
|
|
2021-10-11 18:42:05 +01:00
|
|
|
if (NOT TARGET fmt AND NOT TARGET fmt::fmt)
|
2016-11-24 04:40:15 +00:00
|
|
|
# fmtlib formatting library
|
|
|
|
add_subdirectory(fmt)
|
|
|
|
endif()
|
2016-12-12 14:23:42 +00:00
|
|
|
|
2022-04-19 12:12:19 +01:00
|
|
|
# mcl
|
2020-05-21 21:31:18 +01:00
|
|
|
|
2022-04-19 12:12:19 +01:00
|
|
|
if (NOT TARGET merry::mcl)
|
|
|
|
add_subdirectory(mcl)
|
|
|
|
endif()
|
2020-05-21 21:31:18 +01:00
|
|
|
|
2022-07-10 09:35:44 +01:00
|
|
|
# oaknut
|
|
|
|
|
|
|
|
if (NOT TARGET merry::oaknut)
|
|
|
|
if (ARCHITECTURE STREQUAL "arm64")
|
|
|
|
add_subdirectory(oaknut)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2020-05-21 21:31:18 +01:00
|
|
|
# robin-map
|
|
|
|
|
2021-08-10 15:05:38 +01:00
|
|
|
if (NOT TARGET tsl::robin_map)
|
2021-10-12 09:09:21 +01:00
|
|
|
add_subdirectory(robin-map)
|
2021-08-10 15:05:38 +01:00
|
|
|
endif()
|
2020-05-21 21:31:18 +01:00
|
|
|
|
|
|
|
# xbyak
|
|
|
|
|
2016-12-12 14:23:42 +00:00
|
|
|
if (NOT TARGET xbyak)
|
2020-06-11 13:15:13 +01:00
|
|
|
if (ARCHITECTURE STREQUAL "x86" OR ARCHITECTURE STREQUAL "x86_64")
|
2016-12-12 14:23:42 +00:00
|
|
|
add_library(xbyak INTERFACE)
|
2021-08-07 15:13:38 +01:00
|
|
|
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/xbyak/include)
|
|
|
|
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/xbyak/xbyak DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/xbyak/include)
|
|
|
|
target_include_directories(xbyak SYSTEM INTERFACE ${CMAKE_CURRENT_BINARY_DIR}/xbyak/include)
|
2017-06-12 01:17:04 +01:00
|
|
|
target_compile_definitions(xbyak INTERFACE XBYAK_NO_OP_NAMES)
|
2016-12-12 14:23:42 +00:00
|
|
|
endif()
|
|
|
|
endif()
|
2021-05-25 21:32:34 +01:00
|
|
|
|
|
|
|
# zydis
|
|
|
|
|
2021-08-24 11:28:44 +01:00
|
|
|
if (NOT TARGET Zydis)
|
|
|
|
option(ZYDIS_BUILD_TOOLS "" OFF)
|
|
|
|
option(ZYDIS_BUILD_EXAMPLES "" OFF)
|
2022-11-20 20:52:58 +00:00
|
|
|
option(ZYDIS_BUILD_DOXYGEN "" OFF)
|
|
|
|
set(ZYAN_ZYCORE_PATH "${CMAKE_CURRENT_LIST_DIR}/zycore" CACHE PATH "")
|
2021-08-24 11:28:44 +01:00
|
|
|
add_subdirectory(zydis EXCLUDE_FROM_ALL)
|
|
|
|
endif()
|