From 405e7f25fc6fdb3dcfe6c481cf7e7e70ba039728 Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Fri, 24 May 2024 15:35:43 +0200 Subject: [PATCH] wip --- CMakeLists.txt | 6 +----- third_party/variant/include/mapbox/variant.hpp | 16 +++++++++++++--- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3f57a3052..b99ecd369 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -323,10 +323,6 @@ if (MSVC) add_definitions(-DBOOST_ALL_NO_LIB) endif() -if (MSVC) - add_compile_options(/Zc:__cplusplus) -endif() - if(ENABLE_CONAN) message(STATUS "Installing dependencies via Conan") @@ -367,7 +363,7 @@ if(ENABLE_CONAN) KEEP_RPATHS NO_OUTPUT_DIRS OPTIONS boost:filesystem_version=3 # https://stackoverflow.com/questions/73392648/error-with-boost-filesystem-version-in-cmake - onetbb:shared=${TBB_SHARED} + # onetbb:shared=${TBB_SHARED} boost:without_stacktrace=True # Apple Silicon cross-compilation fails without it BUILD missing ) diff --git a/third_party/variant/include/mapbox/variant.hpp b/third_party/variant/include/mapbox/variant.hpp index 396b4a9eb..e16ec644e 100644 --- a/third_party/variant/include/mapbox/variant.hpp +++ b/third_party/variant/include/mapbox/variant.hpp @@ -15,9 +15,18 @@ #include #include + + // clang-format off + +#ifdef _MSC_VER +# define VARIANT_CPLUSPLUS _MSVC_LANG +#else +# define VARIANT_CPLUSPLUS __cplusplus +#endif + // [[deprecated]] is only available in C++14, use this for the time being -#if __cplusplus <= 201103L +#if VARIANT_CPLUSPLUS <= 201103L # ifdef __GNUC__ # define MAPBOX_VARIANT_DEPRECATED __attribute__((deprecated)) # elif defined(_MSC_VER) @@ -44,6 +53,7 @@ # define VARIANT_INLINE __attribute__((noinline)) # endif #endif + // clang-format on // Exceptions @@ -163,7 +173,7 @@ struct enable_if_type template struct result_of_unary_visit { -#if __cplusplus >= 201703L +#if VARIANT_CPLUSPLUS >= 201703L using type = std::invoke_result_t; #else using type = std::result_of_t; @@ -179,7 +189,7 @@ struct result_of_unary_visit struct result_of_binary_visit { -#if __cplusplus >= 201703L +#if VARIANT_CPLUSPLUS >= 201703L using type = std::invoke_result_t; #else using type = std::result_of_t;