Update needed c++ version

This commit is contained in:
Dawid Drozd 2019-12-29 15:00:20 +01:00
parent d0d236dab0
commit c5756e24a8
2 changed files with 13 additions and 8 deletions

View File

@ -3,12 +3,14 @@ cmake_minimum_required(VERSION 3.11 FATAL_ERROR)
# Layout of project is inspired by: https://youtu.be/6sWec7b0JIc?t=20m50s
# This top level CMakeLists should be used for development
project(EventBusDev)
project(EventBusDev LANGUAGES CXX)
option(ENABLE_TEST "Enable test" ON)
option(ENABLE_PERFORMANCE "Enable performance subproject" OFF)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
add_subdirectory(lib/)
add_subdirectory(use_case/)

View File

@ -9,13 +9,6 @@ project(EventBus
LANGUAGES CXX
)
# Why C++ 17 needed:
# - std::shared_mutex used
# - nested namespaces e.g. my::name::space
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# Dependencies
# No dependencies for EventBus yay!
@ -62,6 +55,16 @@ add_library(EventBus
)
add_library(Dexode::EventBus ALIAS EventBus)
# Why C++ 17 needed:
# - std::shared_mutex used
# - nested namespaces e.g. my::name::space
set_target_properties(EventBus PROPERTIES
CXX_STANDARD 17
CXX_STANDARD_REQUIRED YES
CXX_EXTENSIONS NO # -std=c++17 rather than -std=gnu++17
)
target_compile_features(EventBus PUBLIC cxx_std_17)
target_include_directories(EventBus PUBLIC