-
Notifications
You must be signed in to change notification settings - Fork 12
/
CMakeLists.txt
27 lines (23 loc) · 1.18 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
cmake_minimum_required(VERSION 3.15)
set(CMAKE_DISABLE_SOURCE_CHANGES ON)
set(CMAKE_DISABLE_IN_SOURCE_BUILD ON)
set(CMAKE_SUPPRESS_REGENERATION ON)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/build/${CMAKE_BUILD_TYPE}/)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/build/${CMAKE_BUILD_TYPE}/)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/build/${CMAKE_BUILD_TYPE}/)
# msvc general
set(CMAKE_CXX20_STANDARD_COMPILE_OPTION "-std:c++latest")
set(CMAKE_CXX20_EXTENSION_COMPILE_OPTION "-std:c++latest")
set(CMAKE_CXX_STANDARD 20)
set(COMMON_COMPILE_FLAGS "/DWIN32_LEAN_AND_MEAN /D_CRT_SECURE_NO_WARNINGS /DUNICODE /D_UNICODE")
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set(CMAKE_CXX_FLAGS_RELEASE "${COMMON_COMPILE_FLAGS} /O2 /Gw -flto /DNDEBUG /MT")
set(CMAKE_CXX_FLAGS_DEBUG "${COMMON_COMPILE_FLAGS} /Od /Zi /DDEBUG /MTd")
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
set(CMAKE_CXX_FLAGS_RELEASE "${COMMON_COMPILE_FLAGS} /O2 /Gw /GL /wd4458 /DNDEBUG /MT")
set(CMAKE_CXX_FLAGS_DEBUG "${COMMON_COMPILE_FLAGS} /Od /Zi /wd4458 /DDEBUG /MTd")
else()
message(FATAL_ERROR "Unsupported toolset, use MSVC or Clang for build")
endif()
add_subdirectory( deps )
add_subdirectory( src )