-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
49 lines (42 loc) · 1.35 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
cmake_minimum_required(VERSION 3.14)
project(utpx)
set(CMAKE_VERBOSE_MAKEFILE ON)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.24.0")
cmake_policy(SET CMP0135 NEW)
endif ()
include(FetchContent)
FetchContent_Declare(
elfio
URL https://github.com/serge1/ELFIO/releases/download/Release_3.12/elfio-3.12.tar.gz
URL_HASH SHA256=caf49f3bf55a9c99c98ebea4b05c79281875783802e892729eea0415505f68c4
)
FetchContent_Declare(
json
URL https://github.com/nlohmann/json/releases/download/v3.11.2/json.hpp
URL_HASH SHA256=665fa14b8af3837966949e8eb0052d583e2ac105d3438baba9951785512cf921
DOWNLOAD_NO_EXTRACT YES # this is a header only lib, so don't do anything else
)
FetchContent_MakeAvailable(elfio)
FetchContent_MakeAvailable(json)
add_library(utpx SHARED
utpx.cpp
intercept_kernel.cpp
intercept_memory.cpp
hsaco.cpp
)
target_link_libraries(utpx PRIVATE elfio::elfio)
target_include_directories(utpx PRIVATE ${json_SOURCE_DIR})
target_compile_options(utpx PRIVATE
"-march=native"
"-Wall"
"-ffunction-sections"
"-fdata-sections"
"-Wno-unused-but-set-variable"
"-Wno-unused-variable"
"-Wcast-align"
"-Werror=return-type"
"-Werror=switch"
)