-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
39 lines (30 loc) · 1.1 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
cmake_minimum_required(VERSION 3.6)
project(surf
VERSION 0.0.1
LANGUAGES CXX C)
# C17
set(CMAKE_C_STANDARD 17)
set(CMAKE_C_STANDARD_REQUIRED ON)
# C++ 20
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# Enable folders across CMake project
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
# Set output directory
set(SURF_OUTPUT_DIR ${CMAKE_SOURCE_DIR}/build)
# Limit the configurations to 'Debug' and 'Release'
set(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "" FORCE)
# Set the 'wave' engine as the default startup project
set_directory_properties(PROPERTIES VS_STARTUP_PROJECT wave)
# Set a custom define for debug configurations
add_compile_options("$<$<CONFIG:DEBUG>:-D_WAVE_DEBUG>")
add_compile_options("$<$<CONFIG:DEBUG>:-D_WAVE_ENABLE_LOGGING>")
# Add profiling if flag is specified
set(ENABLE_PROFILING OFF CACHE BOOL "enables profiling for the surf API")
if(${ENABLE_PROFILING})
message(STATUS "[surf] Enabled profiling")
add_compile_options("$<$<CONFIG:DEBUG>:-D_PROFILE_ENABLED>")
endif()
# Build surf client project
add_subdirectory(api)
add_subdirectory(client)