-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
40 lines (32 loc) · 1.13 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
cmake_minimum_required(VERSION 3.25)
project("Vixen")
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
add_link_options(-static -static-libstdc++ -static-libgcc)
add_compile_options(-std=c++20 -Wall -Wextra -Wpedantic)
if (CMAKE_BUILD_TYPE MATCHES "Release")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -O2")
endif ()
if (POLICY CMP0025)
cmake_policy(SET CMP0025 NEW)
endif ()
set(SKIP_INSTALL_ALL ON)
include(FetchContent)
find_package(PkgConfig REQUIRED)
option(ENABLE_VULKAN "Enable or disable Vulkan support" ON)
option(ENABLE_OPENGL "Enable or disable OpenGL support" ON)
option(ENABLE_TESTS "Enable or disable building of the tests" ON)
option(ENABLE_EDITOR "Enable or disable the compilation of the editor" ON)
if (CMAKE_BUILD_TYPE MATCHES "Debug")
add_definitions(-DDEBUG)
else ()
add_link_options(-mwindows)
endif ()
add_subdirectory(src/engine)
if (ENABLE_EDITOR)
add_subdirectory(src/editor)
endif ()