-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
41 lines (31 loc) · 1.06 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.16.0)
# Define the Project Name and Description
project(
crusty_compiler
VERSION 0.1.0
LANGUAGES CXX
DESCRIPTION "A Compiler Frontend for the crust Language :)"
)
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
# Set required C++ Standard
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# Let's ensure -std=c++xx instead of -std=g++xx
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra")
# Let's nicely support folders in IDEs
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
# Testing only available if this is the main app
# Note this needs to be done in the main CMakeLists
# since it calls enable_testing, which must be in the
# main CMakeLists.
include(CTest)
endif()
# FetchContent added in CMake 3.11, downloads during the configure step
include(FetchContent)
# The compiled library code is here
add_subdirectory(lib)
# The executable code is here
add_subdirectory(apps)
# The testing code is here
add_subdirectory(tests)