aboutsummaryrefslogtreecommitdiffhomepage
path: root/externals/CMakeLists.txt
blob: f6b837bc4a94f869c66d95e19489207375faaf13 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# Always build externals as static libraries, even when dynarmic is built as shared
if (BUILD_SHARED_LIBS)
    set(BUILD_SHARED_LIBS OFF)
    set(CMAKE_POSITION_INDEPENDENT_CODE ON)
    set_property(DIRECTORY PROPERTY EXCLUDE_FROM_ALL ON)
endif()

# Allow options shadowing with normal variables when subproject use old cmake policy
set(CMAKE_POLICY_DEFAULT_CMP0077 NEW)

# Disable tests in all externals supporting the standard option name
set(BUILD_TESTING OFF)

# 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.

# biscuit

if (NOT TARGET biscuit::biscuit)
    if ("riscv" IN_LIST ARCHITECTURE)
        add_subdirectory(biscuit)
    endif()
endif()

# catch

if (NOT TARGET Catch2::Catch2WithMain)
    if (DYNARMIC_TESTS)
        add_subdirectory(catch EXCLUDE_FROM_ALL)
    endif()
endif()

# fmt

if (NOT TARGET fmt::fmt)
    # fmtlib formatting library
    set(FMT_INSTALL ON)
    add_subdirectory(fmt)
endif()

# mcl

if (NOT TARGET merry::mcl)
    set(MCL_INSTALL ON)
    add_subdirectory(mcl)
endif()

# oaknut

if (NOT TARGET merry::oaknut)
    if ("arm64" IN_LIST ARCHITECTURE)
        add_subdirectory(oaknut)
    elseif (DYNARMIC_TESTS)
        add_subdirectory(oaknut EXCLUDE_FROM_ALL)
    endif()
endif()

# robin-map

if (NOT TARGET tsl::robin_map)
    add_subdirectory(robin-map)
endif()

# xbyak

if (NOT TARGET xbyak::xbyak)
    if ("x86_64" IN_LIST ARCHITECTURE)
        add_subdirectory(xbyak)
    endif()
endif()

# zydis

if (NOT TARGET Zydis::Zydis)
    if ("x86_64" IN_LIST ARCHITECTURE)
        set(ZYDIS_BUILD_TOOLS OFF)
        set(ZYDIS_BUILD_EXAMPLES OFF)
        set(ZYDIS_BUILD_DOXYGEN OFF)
        set(ZYAN_ZYCORE_PATH "${CMAKE_CURRENT_LIST_DIR}/zycore" CACHE PATH "")
        set(CMAKE_DISABLE_FIND_PACKAGE_Doxygen ON)
        add_subdirectory(zydis)
        add_library(Zydis::Zydis ALIAS Zydis)
    endif()
endif()