-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
62 lines (55 loc) · 2.56 KB
/
Copy pathCMakeLists.txt
File metadata and controls
62 lines (55 loc) · 2.56 KB
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
cmake_minimum_required(VERSION 3.9)
project(dynautic LANGUAGES C CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(LLVM 19.1.7 REQUIRED)
separate_arguments(LLVM_DEFINITIONS)
set(CAPSTONE_BUILD_TESTS OFF)
set(CAPSTONE_BUILD_STATIC OFF)
set(CAPSTONE_BUILD_STATIC_RUNTIME OFF)
set(CAPSTONE_ARCHITECTURE_DEFAULT OFF)
set(CAPSTONE_AARCH64_SUPPORT ON)
add_subdirectory(externals/capstone)
add_library(dynautic STATIC
include/dynautic/common.hpp include/dynautic/optimization.hpp
include/dynautic/A64.hpp
src/llvm.hpp
src/arch_traits.hpp
src/globalmonitor.hpp src/globalmonitor.cpp
src/A64/runtime.hpp src/A64/runtime.cpp
src/A64/cache.hpp src/A64/cache.cpp
src/A64/lifter.hpp src/A64/lifter.cpp
src/A64/lifter_instance.hpp src/A64/lifter_instance.cpp
src/A64/lifter_instructions.hpp src/A64/lifter_instructions.cpp
src/A64/lifter_instructions_macros.hpp
src/A64/lifter_instructions_base.cpp
src/A64/lifter_instructions_vector.cpp
src/A64/lifter_instructions_fp.cpp
src/A64/lifter_registers.cpp
src/A64/lifter_shifts.cpp
src/A64/lifter_glue_emitters.cpp
src/A64/lifter_conditions.cpp
src/A64/lifter_trampolines.cpp
src/timer.hpp
)
target_include_directories(dynautic PRIVATE ${LLVM_INCLUDE_DIRS} PUBLIC include)
target_compile_definitions(dynautic PRIVATE ${LLVM_DEFINITIONS})
target_link_libraries(dynautic PRIVATE capstone ubsan)
target_precompile_headers(dynautic PRIVATE src/llvm.hpp)
target_compile_options(dynautic PRIVATE -fno-exceptions -funwind-tables)
llvm_config(dynautic USE_SHARED core executionengine orcjit nativecodegen)
target_compile_options(dynautic PRIVATE -Wno-error=cast-qual -Wno-error=implicit-fallthrough -Wno-string-conversion -Wno-sign-conversion)
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
target_compile_definitions(dynautic PRIVATE
ENABLE_LLVM_VALIDATION
ENABLE_ASSERTS
#ENABLE_RUNTIME_DEBUG_MESSAGES
)
target_compile_options(dynautic PRIVATE -fsanitize=undefined)
else()
target_compile_options(dynautic PRIVATE -fsanitize=bounds,null,return,unreachable)
endif()
install(TARGETS dynautic
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)