-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
49 lines (40 loc) · 1.34 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
cmake_minimum_required(VERSION 3.5)
project(MQTTBroker LANGUAGES CXX)
include(GNUInstallDirs)
set(ignoreMe ${CMAKE_VERBOSE_MAKEFILE})
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
include(format)
include(doxygen)
include(uninstall)
include(iwyu)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
add_compile_options(
-Werror
-Wall
-Wextra
-Wconversion
-Wpedantic
-Wconversion
-Wuninitialized
-Wunreachable-code
-Wfloat-equal
-pedantic-errors
-fexec-charset=UTF-8
-Wno-shadow # yes we do
-Wno-psabi # needed for RaspberryPi
$<$<CXX_COMPILER_ID:Clang>:-Weverything>
$<$<CXX_COMPILER_ID:Clang>:-Wno-c++98-compat-pedantic>
$<$<CXX_COMPILER_ID:Clang>:-Wno-exit-time-destructors>
$<$<CXX_COMPILER_ID:Clang>:-Wno-global-constructors>
$<$<CXX_COMPILER_ID:Clang>:-Wno-shadow-field>
$<$<CXX_COMPILER_ID:Clang>:-Wno-padded>
$<$<CXX_COMPILER_ID:Clang>:-Wno-documentation-unknown-command>
$<$<AND:$<CXX_COMPILER_ID:Clang>,$<VERSION_GREATER_EQUAL:$<CXX_COMPILER_VERSION>,16.0>>:-Wno-unsafe-buffer-usage>
$<$<AND:$<CXX_COMPILER_ID:Clang>,$<VERSION_GREATER_EQUAL:$<CXX_COMPILER_VERSION>,18.0>>:-Wno-switch-default>
)
add_link_options(LINKER:--no-undefined)
add_subdirectory(lib)
add_subdirectory(mqttbroker)
add_subdirectory(mqttintegrator)
add_subdirectory(mqttbridge)