diff --git a/CMakeLists.txt b/CMakeLists.txt index 81aa99a48..d00ded104 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -48,6 +48,19 @@ if(APPLE) set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:/opt/local/lib/pkgconfig") endif() +# check compiler version +if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") + # require at least gcc 8 + if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8) + message(FATAL_ERROR "GCC version must be at least 8!") + endif() +elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") + # require at least clang 7 + if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7) + message(FATAL_ERROR "Clang version must be at least 7!") + endif() +endif() + include(FindPkgConfig) include(CheckIncludeFile) include(FeatureSummary) diff --git a/include/villas/config.hpp b/include/villas/config.hpp index 6f68629fa..b1454e3c4 100644 --- a/include/villas/config.hpp +++ b/include/villas/config.hpp @@ -25,23 +25,15 @@ #include #include - #include #include -#if __has_include() - #include - namespace fs = std::filesystem; -#elif __has_include() - #include - namespace fs = std::experimental::filesystem; -#else - error "Missing the header." -#endif +#include #include - #include #include +namespace fs = std::filesystem; + namespace villas { namespace node { diff --git a/lib/config.cpp b/lib/config.cpp index 94cf483aa..e98174f6f 100644 --- a/lib/config.cpp +++ b/lib/config.cpp @@ -23,21 +23,11 @@ #include #include - #include #include #include #include -#if __has_include() - #include - namespace fs = std::filesystem; -#elif __has_include() - #include - namespace fs = std::experimental::filesystem; -#else - error "Missing the header." -#endif - +#include #include #include #include @@ -47,6 +37,7 @@ using namespace villas; using namespace villas::node; +namespace fs = std::filesystem; Config::Config() : logger(logging.get("config")),