forked from Vector35/arch-arm64
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
85 lines (75 loc) · 2.1 KB
/
CMakeLists.txt
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
cmake_minimum_required(VERSION 3.9 FATAL_ERROR)
project(arch_arm64 CXX C)
file(GLOB SOURCES
*.cpp
*.c
*.h
disassembler/decode.c
disassembler/format.c
disassembler/sysregs.c
disassembler/regs.c
disassembler/encodings_dec.c
disassembler/encodings_fmt.c
disassembler/operations.c
disassembler/pcode.c
disassembler/decode0.c
disassembler/decode1.c
disassembler/decode2.c
disassembler/decode_fields32.c
disassembler/decode_scratchpad.c
disassembler/*.h)
if(DEMO)
add_library(${PROJECT_NAME} STATIC ${SOURCES})
else()
add_library(${PROJECT_NAME} SHARED ${SOURCES})
endif()
if(NOT WIN32)
set_source_files_properties(disassembler/arm64dis.c PROPERTIES COMPILE_FLAGS -fno-strict-aliasing)
endif()
target_include_directories(${PROJECT_NAME}
PRIVATE ${PROJECT_SOURCE_DIR}
PRIVATE ${PROJECT_SOURCE_DIR}/disassembler)
if((NOT BN_API_BUILD_EXAMPLES) AND (NOT BN_INTERNAL_BUILD))
# Out-of-tree build
find_path(
BN_API_PATH
NAMES binaryninjaapi.h
HINTS . .. ../.. binaryninjaapi $ENV{BN_API_PATH}
PATH_SUFFIXES binaryninja-api
REQUIRED
)
message(STATUS "Found Binary Ninja API Path: ${BN_API_PATH}")
add_subdirectory(${BN_API_PATH} api)
target_link_libraries(${PROJECT_NAME} binaryninjaapi)
else()
if(WIN32)
target_link_directories(${PROJECT_NAME}
PRIVATE ${BN_INSTALL_DIR})
target_link_libraries(${PROJECT_NAME} binaryninjaapi binaryninjacore)
else()
target_link_libraries(${PROJECT_NAME} binaryninjaapi)
endif()
endif()
IF(DEFINED ENV{ARM64_WARNINGS})
MESSAGE(STATUS "ARM64 WARNINGS ON")
target_compile_options(${PROJECT_NAME} PRIVATE -Wall)
ELSE()
MESSAGE(STATUS "ARM64 WARNINGS OFF")
ENDIF()
set_target_properties(${PROJECT_NAME} PROPERTIES
CXX_STANDARD 17
CXX_VISIBILITY_PRESET hidden
CXX_STANDARD_REQUIRED ON
C_STANDARD 99
C_STANDARD_REQUIRED ON
C_VISIBILITY_PRESET hidden
VISIBILITY_INLINES_HIDDEN ON
POSITION_INDEPENDENT_CODE ON)
if(BN_INTERNAL_BUILD)
plugin_rpath(${PROJECT_NAME})
set_target_properties(${PROJECT_NAME} PROPERTIES
LIBRARY_OUTPUT_DIRECTORY ${BN_CORE_PLUGIN_DIR}
RUNTIME_OUTPUT_DIRECTORY ${BN_CORE_PLUGIN_DIR})
else()
bn_install_plugin(${PROJECT_NAME})
endif()