-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
41 lines (38 loc) · 1.44 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
cmake_minimum_required(VERSION 3.0.0)
project(DigiPlane C CXX)
set(CMAKE_CXX_STANDARD 20)
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
message(STATUS "GCC detected, adding compile options")
if (CMAKE_BUILD_TYPE MATCHES "Debug")
message(STATUS "Debug build detected, adding compile options")
add_compile_options(-Wall -Wextra -Wpedantic -g -O0)
else()
message(STATUS "Release build detected, adding compile options")
add_compile_options(-Wall -Wextra -Wpedantic -O3)
endif()
elseif (CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
message(STATUS "MSVC detected, adding compile options")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SUBSYSTEM:WINDOWS /ENTRY:mainCRTStartup") # Use main instead of WinMain
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
message(STATUS "Debug build detected, adding compile options")
add_compile_options(/W4 /Od /Zi /EHsc)
else()
message(STATUS "Release build detected, adding compile options")
add_compile_options(/W4 /O2 /EHsc)
endif()
endif()
# Include directories for all targets
include_directories(
${CMAKE_SOURCE_DIR}/include
)
# foundation TODO: use find_package instead of add_subdirectory
add_subdirectory(modules/flecs)
#add_subdirectory(modules/openal-soft)
add_subdirectory(modules/glfw)
add_subdirectory(modules/DiligentCore)
add_subdirectory(modules/Lua)
# intermediary
add_subdirectory(Core)
# final
add_subdirectory(Editor)
add_subdirectory(Runtime)