-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
36 lines (29 loc) · 850 Bytes
/
Copy pathCMakeLists.txt
File metadata and controls
36 lines (29 loc) · 850 Bytes
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
cmake_minimum_required(VERSION 3.20)
project(opainject_macos C)
# Enable Objective-C
enable_language(OBJC)
# Set architectures to both arm64 and arm64e (universal binary)
set(CMAKE_OSX_ARCHITECTURES "arm64;arm64e")
# Set deployment target
set(CMAKE_OSX_DEPLOYMENT_TARGET "11.0")
# Create executable
add_executable(opainject
main.m
dyld.m
rop_inject.m
thread_utils.m
task_utils.m
arm64.m
)
# Compiler flags
target_compile_options(opainject PRIVATE
-fobjc-arc
-Wno-deprecated-declarations
)
# Link frameworks
target_link_libraries(opainject "-framework CoreFoundation")
# Code signing with entitlements
add_custom_command(TARGET opainject POST_BUILD
COMMAND codesign -s - --entitlements ${CMAKE_CURRENT_SOURCE_DIR}/entitlements.plist --force $<TARGET_FILE:opainject>
COMMENT "Signing with entitlements"
)