-
Notifications
You must be signed in to change notification settings - Fork 37
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
67 lines (55 loc) · 2.64 KB
/
Copy pathCMakeLists.txt
File metadata and controls
67 lines (55 loc) · 2.64 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
cmake_minimum_required(VERSION 3.16.0 FATAL_ERROR)
project(PlantsVsZombies C CXX)
################################################################################
# Global configuration types
################################################################################
set(CMAKE_CONFIGURATION_TYPES
"Debug"
"Release"
CACHE STRING "List of supported configurations." FORCE
)
set(CMAKE_CXX_STANDARD 23)
# @Patoke todo: probably add MSVC counterparts?
if(MSVC)
set(universal_compiler_flags "")
else()
#set(universal_compiler_flags "-fsanitize=undefined -fsanitize-trap -pthread -fuse-ld=lld -fno-omit-frame-pointer -fstack-protector-all -fms-extensions -fdiagnostics-color=always -gdwarf-2 -O0")
set(universal_compiler_flags "-pthread -fuse-ld=lld -fms-extensions -march=native -fdiagnostics-color=always -O3")
endif()
set(universal_cxxflags "${CMAKE_CXX_FLAGS} ${universal_compiler_flags}")
set(universal_cflags "${CMAKE_C_FLAGS} ${universal_compiler_flags}")
if(MSVC)
set(warn_flags "")
else()
set(warn_flags "-Wall -Wextra -Werror")
endif()
set(CMAKE_CXX_FLAGS "${universal_cxxflags} ${warn_flags}")
set(CMAKE_C_FLAGS "${universal_cflags} ${warn_flags}")
set(CMAKE_BUILD_TYPE Debug)
set(CMAKE_EXPORT_COMPILE_COMMANDS 1)
set(CMAKE_RC_COMPILER_INIT windres)
ENABLE_LANGUAGE(RC)
################################################################################
# Nuget packages function stub.
################################################################################
function(use_package TARGET PACKAGE VERSION)
message(WARNING "No implementation of use_package. Create yours. "
"Package \"${PACKAGE}\" with version \"${VERSION}\" "
"for target \"${TARGET}\" is ignored!")
endfunction()
################################################################################
# Common utils
################################################################################
include(CMake/Utils.cmake)
################################################################################
# Additional Global Settings(add specific info there)
################################################################################
include(CMake/GlobalSettingsInclude.cmake OPTIONAL)
################################################################################
# Use solution folders feature
################################################################################
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
################################################################################
# Sub-projects
################################################################################
add_subdirectory(SexyAppFramework)