-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
42 lines (32 loc) · 990 Bytes
/
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
cmake_minimum_required(VERSION 3.10)
project(xspeedhack)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
if(MSVC)
add_compile_options(
$<$<CONFIG:>:/MT> #---------- Multithreaded
$<$<CONFIG:Debug>:/MTd> #---- Multithreaded Debug
$<$<CONFIG:Release>:/MT> #--- Multithreaded
)
endif()
# Injector executable
set(EXE_SOURCES
cpp/injector.cpp
)
add_executable(injector ${EXE_SOURCES})
# DLL Speedhack
set(LIB_SOURCES
cpp/dll_main.cpp
)
include_directories("${CMAKE_SOURCE_DIR}/deps/include")
add_library(speedhack SHARED ${LIB_SOURCES})
# Check if the platform is 64-bit or 32-bit
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
# 64-bit
set(DETOURS_LIB_PATH "${CMAKE_SOURCE_DIR}/deps/lib/detoursx64.lib")
else()
# 32-bit
set(DETOURS_LIB_PATH "${CMAKE_SOURCE_DIR}/deps/lib/detoursx86.lib")
endif()
target_link_libraries(speedhack PRIVATE ${DETOURS_LIB_PATH})