-
Notifications
You must be signed in to change notification settings - Fork 5
/
CMakeLists.txt
37 lines (29 loc) · 1.07 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
cmake_minimum_required(VERSION 3.16)
project(rcmp)
set(RCMP_VERSION_MAJOR 0)
set(RCMP_VERSION_MINOR 2)
set(RCMP_VERSION_PATCH 2)
set(RCMP_EXTERNAL_DIR ${PROJECT_SOURCE_DIR}/external)
set(RCMP_SOURCE_DIR ${PROJECT_SOURCE_DIR}/source)
add_library(rcmp STATIC
${RCMP_SOURCE_DIR}/codegen.cpp
${RCMP_SOURCE_DIR}/memory.cpp
${RCMP_SOURCE_DIR}/detail/arch/impl.cpp
${RCMP_SOURCE_DIR}/detail/platform/impl.cpp
)
target_compile_features(rcmp PUBLIC cxx_std_17)
target_include_directories(rcmp PUBLIC
${PROJECT_SOURCE_DIR}/include
${RCMP_EXTERNAL_DIR}/nmd/include
)
target_compile_definitions(rcmp PUBLIC RCMP_VERSION_MAJOR=${RCMP_VERSION_MAJOR})
target_compile_definitions(rcmp PUBLIC RCMP_VERSION_MINOR=${RCMP_VERSION_MINOR})
target_compile_definitions(rcmp PUBLIC RCMP_VERSION_PATCH=${RCMP_VERSION_PATCH})
if(MSVC)
target_compile_options(rcmp PRIVATE /W4)
else()
target_compile_options(rcmp PRIVATE -Wall -Wextra -pedantic)
endif()
if (${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR})
add_subdirectory(test)
endif()