forked from Hackerl/python-loader
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
45 lines (31 loc) · 1.13 KB
/
CMakeLists.txt
File metadata and controls
45 lines (31 loc) · 1.13 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
cmake_minimum_required(VERSION 3.17)
project(python_loader)
set(CMAKE_CXX_STANDARD 14)
option(STATIC_BUILD "enable static build" OFF)
set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/lib)
set(ZYDIS_BUILD_TOOLS OFF CACHE BOOL "disable disassembler tools")
set(ZYDIS_BUILD_EXAMPLES OFF CACHE BOOL "disable disassembler examples")
set(C_RUNTIME_HEAP_CACHE OFF CACHE BOOL "disable heap memory cache")
include(FetchContent)
FetchContent_Declare(
ELFIO
GIT_REPOSITORY https://github.com/serge1/ELFIO
GIT_TAG Release_3.10
)
FetchContent_MakeAvailable(ELFIO)
FetchContent_Declare(
trap
GIT_REPOSITORY https://github.com/Hackerl/trap
GIT_TAG master
)
FetchContent_MakeAvailable(trap)
FetchContent_Declare(
c-runtime
GIT_REPOSITORY https://github.com/Hackerl/c-runtime
GIT_TAG master
)
FetchContent_MakeAvailable(c-runtime)
add_executable(python_loader main.cpp heap/memory.cpp)
target_link_libraries(python_loader trap c_runtime elfio $<$<BOOL:${STATIC_BUILD}>:-static-pie>)