-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
69 lines (54 loc) · 1.91 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
cmake_minimum_required(VERSION 2.8.7)
project(masterlib C CXX)
if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "No build type selected, default to Debug")
set(CMAKE_BUILD_TYPE "Debug")
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -std=c++11 -stdlib=libc++")
file(GLOB_RECURSE masterlib_HEADERS "src/*.h")
set (masterlib_INCLUDE_DIRS "")
foreach (_headerFile ${masterlib_HEADERS})
get_filename_component(_dir ${_headerFile} PATH)
list (APPEND masterlib_INCLUDE_DIRS ${_dir})
endforeach()
list(REMOVE_DUPLICATES masterlib_INCLUDE_DIRS)
file(GLOB liberation_SRC
"src/*.cc"
"src/*.c"
"src/*.h"
)
if (NOT DEFINED IOS_PLATFORM)
file(GLOB liberation_arch_specific_SRC
"src/x64/*.cc"
"src/x64/*.h"
"src/x86/*.cc"
"src/x86/*.h"
)
else()
file(GLOB liberation_arch_specific_SRC
"src/aarch64/*.cc"
"src/aarch64/*.h"
"src/armv7/*.cc"
"src/armv7/*.h"
)
endif()
file(GLOB liberation_test_SRC
"tests/main.cc"
)
add_subdirectory("${CMAKE_SOURCE_DIR}/third_party/capstone")
add_library(masterlib STATIC ${liberation_SRC} ${liberation_arch_specific_SRC})
add_executable(masterlib_test ${liberation_test_SRC})
target_include_directories(masterlib PUBLIC
$<BUILD_INTERFACE:${masterlib_INCLUDE_DIRS}>
$<INSTALL_INTERFACE:${masterlib_INCLUDE_DIRS}>)
set(CMAKE_MACOSX_BUNDLE YES)
set(MACOSX_BUNDLE_GUI_IDENTIFIER "org.satorify")
set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO")
set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "Don't Code Sign")
target_link_libraries(masterlib capstone-static)
target_link_libraries(masterlib_test masterlib)
# add_custom_target(install
# COMMAND make
# COMMAND ldid -S${CMAKE_SOURCE_DIR}/ent.plist ${CMAKE_SOURCE_DIR}/build/masterlib_test
# COMMAND scp -P $ENV{THEOS_DEVICE_PORT} ${CMAKE_SOURCE_DIR}/build/masterlib_test root@$ENV{THEOS_DEVICE_IP}:/usr/bin/masterlib
# )