summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--conf/dist/config.cmake3
-rw-r--r--src/cmake/macros/ConfigureBaseTargets.cmake37
-rw-r--r--src/cmake/showoptions.cmake6
3 files changed, 21 insertions, 25 deletions
diff --git a/conf/dist/config.cmake b/conf/dist/config.cmake
index 9c239b2335..728323112d 100644
--- a/conf/dist/config.cmake
+++ b/conf/dist/config.cmake
@@ -84,3 +84,6 @@ endif()
# Source tree in IDE
set(WITH_SOURCE_TREE "hierarchical" CACHE STRING "Build the source tree for IDE's.")
set_property(CACHE WITH_SOURCE_TREE PROPERTY STRINGS no flat hierarchical)
+
+# If disable - use c++17
+option(USE_CPP_20 "Enable c++20 standard" 0)
diff --git a/src/cmake/macros/ConfigureBaseTargets.cmake b/src/cmake/macros/ConfigureBaseTargets.cmake
index 693f4e8f6c..2a713429b0 100644
--- a/src/cmake/macros/ConfigureBaseTargets.cmake
+++ b/src/cmake/macros/ConfigureBaseTargets.cmake
@@ -9,28 +9,15 @@ add_library(acore-compile-option-interface INTERFACE)
# Use -std=c++11 instead of -std=gnu++11
set(CXX_EXTENSIONS OFF)
-# Enable support С++17
-set(CMAKE_CXX_STANDARD 17)
-message(STATUS "Enabled С++17 support")
-
-# An interface library to make the target features available to other targets
-add_library(acore-feature-interface INTERFACE)
-
-target_compile_features(acore-feature-interface
- INTERFACE
- cxx_alias_templates
- cxx_auto_type
- cxx_constexpr
- cxx_decltype
- cxx_decltype_auto
- cxx_final
- cxx_lambdas
- cxx_generic_lambdas
- cxx_variadic_templates
- cxx_defaulted_functions
- cxx_nullptr
- cxx_trailing_return_types
- cxx_return_type_deduction)
+if (USE_CPP_20)
+ # Enable support С++20
+ set(CMAKE_CXX_STANDARD 20)
+ message(STATUS "Enabled С++20 standard")
+else()
+ # Enable support С++17
+ set(CMAKE_CXX_STANDARD 17)
+ message(STATUS "Enabled С++17 standard")
+endif()
# An interface library to make the warnings level available to other targets
# This interface taget is set-up through the platform specific script
@@ -38,10 +25,10 @@ add_library(acore-warning-interface INTERFACE)
# An interface used for all other interfaces
add_library(acore-default-interface INTERFACE)
+
target_link_libraries(acore-default-interface
INTERFACE
- acore-compile-option-interface
- acore-feature-interface)
+ acore-compile-option-interface)
# An interface used for silencing all warnings
add_library(acore-no-warning-interface INTERFACE)
@@ -75,4 +62,4 @@ add_library(acore-core-interface INTERFACE)
target_link_libraries(acore-core-interface
INTERFACE
acore-default-interface
- acore-warning-interface) \ No newline at end of file
+ acore-warning-interface)
diff --git a/src/cmake/showoptions.cmake b/src/cmake/showoptions.cmake
index b2e4ee88fb..2e248c95cb 100644
--- a/src/cmake/showoptions.cmake
+++ b/src/cmake/showoptions.cmake
@@ -158,4 +158,10 @@ if(BUILD_SHARED_LIBS)
WarnAboutSpacesInBuildPath()
endif()
+if (USE_CPP_20)
+ message("")
+ message(" *** Enabled C++20 standart")
+ message(" *** Please note that this is an experimental feature!")
+endif()
+
message("")