-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
35 lines (27 loc) · 1.06 KB
/
Copy pathCMakeLists.txt
File metadata and controls
35 lines (27 loc) · 1.06 KB
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
cmake_minimum_required(VERSION 3.19 FATAL_ERROR)
project(LunarYue VERSION 0.1.0)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(BUILD_SHARED_LIBS OFF)
include(CMakeDependentOption)
# ---- Include guards ----
if(PROJECT_SOURCE_DIR STREQUAL PROJECT_BINARY_DIR)
message(
FATAL_ERROR
"In-source builds not allowed. Please make a new directory (called a build directory) and run CMake from there."
)
endif()
# ---- Vendored dependency compatibility ----
# rttr (vendored in source/3rdparty) declares cmake_minimum_required(VERSION 3.0).
# CMake 3.27+ deprecates and CMake 4.x removes support for minimums below 3.5,
# which fails the configure. Allow a policy floor so the vendored dependency
# keeps configuring on modern CMake.
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.27)
set(CMAKE_POLICY_VERSION_MINIMUM 3.5)
endif()
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
# Update if necessary
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=implicit-const-int-float-conversion")
endif()
set(ASSET_DIR "data")
add_subdirectory(source)