-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
39 lines (33 loc) · 1.42 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
cmake_minimum_required(VERSION 3.30)
project(oberon-lang VERSION 0.1.0)
set(SMB_FILE_VERSION 4)
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
# warning level 4
add_compile_options(/Wall /W4 /external:anglebrackets /external:W0)
else ()
# lots of warnings and all warnings as errors -Wglobal-constructors -Wexit-time-destructors
add_compile_options(-W -Wall -Wextra -Werror -Wpedantic -Wno-error=deprecated -Wunreachable-code -Winvalid-pch -Wcast-align -Wformat=2 -Wformat-nonliteral -Wmissing-declarations -Wmissing-noreturn -Wmissing-format-attribute -Wmissing-include-dirs -Wredundant-decls -Wswitch-default -Wsign-conversion -Wfloat-conversion)
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-Woverloaded-virtual>)
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wweak-vtables)
if (WIN32)
add_compile_options(-fms-extensions)
endif ()
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
# using GCC
endif ()
endif ()
# compile error for LLVM 16 with C++23
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
# define DEBUG
if (CMAKE_BUILD_TYPE MATCHES Debug)
add_definitions(-D_DEBUG)
endif ()
# add the cmake folder of the project for extension modules
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
add_subdirectory(src)
add_subdirectory(liboberon)
add_subdirectory(test)
add_subdirectory(docs)