-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
54 lines (43 loc) · 1.67 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
50
51
52
53
54
cmake_minimum_required(VERSION 3.15)
cmake_policy(SET CMP0091 NEW)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
project(hry-core VERSION 1.0.7)
add_subdirectory(vendor)
# core
file(GLOB_RECURSE hry-core-src include/*.hpp src/*.hpp src/*.cpp)
add_library(hry-core SHARED ${hry-core-src})
target_compile_definitions(hry-core PUBLIC _USE_MATH_DEFINES)
target_compile_definitions(hry-core PRIVATE HRY_EXPORT _CRT_SECURE_NO_WARNINGS)
# vscode doesn't like relative paths in errors :/
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
target_compile_options(hry-core PUBLIC -fdiagnostics-absolute-paths)
endif()
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
target_compile_options(
hry-core
PUBLIC -Wnon-virtual-dtor
-Wunused
-Woverloaded-virtual
-Wnull-dereference
-Wdouble-promotion
-Wformat=2
-Wmisleading-indentation
-Wparentheses
-Wswitch
-Wswitch-bool
-Wextra
-Wpedantic)
endif()
target_include_directories(hry-core PUBLIC include vendor/json/include
vendor/imgui)
target_include_directories(hry-core PRIVATE src vendor/scs_sdk/include
vendor/imgui_markdown)
target_link_libraries(hry-core PUBLIC fmt::fmt-header-only)
target_link_libraries(hry-core PRIVATE imgui glad minhook)
# example
project(hry-example VERSION 1.0.0)
add_library(hry-example SHARED example/example.hpp example/example.cpp)
target_link_libraries(hry-example PRIVATE hry-core)