GTA_SA_cheat/CMakeLists.txt

62 lines
1.6 KiB
CMake
Raw Normal View History

2021-03-04 22:14:31 +01:00
cmake_minimum_required(VERSION 3.19)
project(GTA_SA_cheat)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_COMPILER_LAUNCHER ccache)
find_package(OpenMP REQUIRED)
# see https://cmake.org/cmake/help/latest/module/FindBoost.html
find_package(Boost REQUIRED)
include_directories(${Boost_INCLUDE_DIR})
set(COMPILE_DEFINITIONS
$<$<CONFIG:DEBUG>:_LIBCPP_DEBUG>
#[[_FORTIFY_SOURCE=2]]
)
set(COMPILE_FLAGS
-pipe
-march=skylake # change to native or your architecture.
-mtune=skylake # same as above
-mrdseed # be careful about this, this is linked to the x86 architecture.
-mrdrnd # same as above
-stdlib=libc++
-Wpedantic
-Wall
-Wextra
-Wmove
-Wopenmp
-funroll-loops
-flto=thin
-fwhole-program-vtables
-fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free
)
set(LINKER_OPTIONS
-Wl,--sort-common,--as-needed
-stdlib=libc++
-flto=thin
-fwhole-program-vtables
-fuse-ld=gold
)
set(LINKER_FLAGS
jemalloc
OpenMP::OpenMP_CXX
)
add_subdirectory(external/frozen EXCLUDE_FROM_ALL)
target_compile_definitions(frozen INTERFACE ${COMPILE_DEFINITIONS})
target_compile_options(frozen INTERFACE ${COMPILE_FLAGS})
target_link_options(frozen INTERFACE ${LINKER_OPTIONS})
2021-03-11 17:41:48 +01:00
target_link_libraries(frozen INTERFACE ${Boost_LIBRARIES} jemalloc)
2021-03-04 22:14:31 +01:00
add_executable(GTA_SA_cheat main.cpp)
target_compile_definitions(GTA_SA_cheat PRIVATE ${COMPILE_DEFINITIONS})
target_compile_options(GTA_SA_cheat PRIVATE ${COMPILE_FLAGS})
target_link_options(GTA_SA_cheat PRIVATE ${LINKER_OPTIONS})
2021-03-11 17:41:48 +01:00
target_link_libraries(GTA_SA_cheat ${LINKER_FLAGS} ${Boost_LIBRARIES} frozen)