-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
54 lines (41 loc) · 1.45 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
42
43
44
45
46
47
48
49
50
51
52
53
54
# configure cmake version
cmake_minimum_required(VERSION 3.28 FATAL_ERROR)
# cmake include modules
include(FetchContent)
include(CMakePrintHelpers)
# configure cmake
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
project(Arctic
LANGUAGES "CXX")
#add_executable(Arctic main.cpp)
#return()
#cmake_print_variables(CMAKE_CXX_COMPILER_ID)
#cmake_print_variables(CMAKE_CXX_COMPILER_VERSION)
#cmake_print_variables(CMAKE_CXX_COMPILER)
# check platform
if(NOT UNIX)
# throw error: no other OS supported
message(FATAL_ERROR "Project must be compiled on Unix!")
endif()
# check compiler: force use clang (for the moment)
if(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
if(${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 16.0.4)
message(FATAL_ERROR "Clang compiler version is smaller then 16.0.4! Current compiler version is ${CMAKE_CXX_COMPILER_VERSION}")
endif()
else()
message(FATAL_ERROR "Project must be compiled using preset! Current compiler is ${CMAKE_CXX_COMPILER_ID}")
endif()
# c++ flags
#add_compile_options(-Wshadow)
# defines
add_definitions(-DARCTIC_ASSETS_DIR="${CMAKE_CURRENT_LIST_DIR}/assets")
# set vulkan flags
add_definitions(-DVK_USE_PLATFORM_XCB_KHR)
add_definitions(-DGLFW_EXPOSE_NATIVE_X11)
add_compile_options(-Wno-nullability-completeness) # for Vulkan Memory Allocator
# add sub directories
add_subdirectory(external)
add_subdirectory(src)