-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
63 lines (54 loc) · 1.63 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
55
56
57
58
59
60
61
62
63
cmake_minimum_required(VERSION 3.15)
project(RTSHA LANGUAGES CXX)
set(cppwinrt_DIR "C:/Program Files (x86)/Windows Kits/10/bin/10.0.22621.0/x64")
# Set C++20 standard
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# Include directories
include_directories(${CMAKE_SOURCE_DIR}/include)
# Source files
set(SOURCE_FILES
src/allocator.cpp
src/arm_spec_functionscpp.cpp
src/BigMemoryPage.cpp
src/FreeList.cpp
src/FreeListArray.cpp
src/FreeMap.cpp
src/Heap.cpp
src/MemoryBlock.cpp
src/MemoryPage.cpp
src/PowerTwoMemoryPage.cpp
src/SmallFixMemoryPage.cpp
)
# Define library or executable target
add_library(RTSHA STATIC ${SOURCE_FILES})
# Compiler-specific options
if(MSVC)
target_compile_options(RTSHA PRIVATE
$<$<CONFIG:Debug>:/DDEBUG /DMI_DEBUG=3>
$<$<CONFIG:Release>:/DNDEBUG>
/W4 # Warning level 4
/std:c++20
)
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
target_compile_options(RTSHA PRIVATE
$<$<CONFIG:Debug>:-DDEBUG -DMI_DEBUG=3>
$<$<CONFIG:Release>:-DNDEBUG>
-Wall -Wextra # Enable most warnings
-std=c++20
)
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
target_compile_options(RTSHA PRIVATE
$<$<CONFIG:Debug>:-DDEBUG -DMI_DEBUG=3>
$<$<CONFIG:Release>:-DNDEBUG>
-Wall -Wextra # Enable most warnings
-std=c++20
)
endif()
# Include CppWinRT (Adjust this part according to your setup)
# find_package(cppwinrt REQUIRED)
# target_link_libraries(RTSHA cppwinrt::cppwinrt)
if(WIN64)
target_link_libraries(RTSHA WindowsApp.lib)
endif()
message("CMAKE_BINARY_DIR: ${CMAKE_BINARY_DIR}")