diff --git a/conanfile.py b/conanfile.py index ad62d4a8..7b66b612 100644 --- a/conanfile.py +++ b/conanfile.py @@ -77,10 +77,11 @@ class UnitsConan(ConanFile): def requirements(self): compiler = self.settings.compiler + version = Version(self.settings.compiler.version) if self._use_libfmt: self.requires("fmt/8.0.1") - if compiler == "clang" and compiler.libcxx == "libc++": + if compiler == "clang" and compiler.libcxx == "libc++" and version < "14.0": self.requires("range-v3/0.11.0") def build_requirements(self): diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index e73e63f7..a41e5bc3 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -45,7 +45,7 @@ target_include_directories(mp-units-core ${unitsAsSystem} INTERFACE ) if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") - if(${projectPrefix}LIBCXX) + if(${projectPrefix}LIBCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "14") find_package(range-v3 CONFIG REQUIRED) target_link_libraries(mp-units-core INTERFACE range-v3::range-v3) endif() diff --git a/src/core/include/units/bits/external/hacks.h b/src/core/include/units/bits/external/hacks.h index 821590f7..1db8e7de 100644 --- a/src/core/include/units/bits/external/hacks.h +++ b/src/core/include/units/bits/external/hacks.h @@ -84,7 +84,7 @@ #include #include -#elif UNITS_COMP_CLANG == 13 || UNITS_COMP_CLANG == 14 +#elif UNITS_COMP_CLANG == 13 #include @@ -228,15 +228,10 @@ constexpr bool in_range(T t) noexcept std::cmp_less_equal(t, std::numeric_limits::max()); } -#elif UNITS_COMP_CLANG == 13 || UNITS_COMP_CLANG == 14 - -#if UNITS_COMP_CLANG == 13 +#elif UNITS_COMP_CLANG == 13 using concepts::three_way_comparable; using concepts::three_way_comparable_with; - -#endif - using ::ranges::compare_three_way; #endif diff --git a/src/core/include/units/quantity.h b/src/core/include/units/quantity.h index ee879311..93b64007 100644 --- a/src/core/include/units/quantity.h +++ b/src/core/include/units/quantity.h @@ -383,7 +383,7 @@ public: }; // CTAD -#if !UNITS_COMP_CLANG || UNITS_COMP_CLANG > 13 +#if !UNITS_COMP_CLANG || UNITS_COMP_CLANG > 14 template explicit(false) quantity(Rep&&) -> quantity; #endif diff --git a/src/mp-unitsConfig.cmake b/src/mp-unitsConfig.cmake index a6360a6d..afe3f7a1 100644 --- a/src/mp-unitsConfig.cmake +++ b/src/mp-unitsConfig.cmake @@ -45,7 +45,7 @@ find_dependency(gsl-lite) # add range-v3 dependency only for clang + libc++ if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") __check_libcxx_in_use(__units_libcxx) - if(__units_libcxx) + if(__units_libcxx AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "14") find_dependency(range-v3) endif() unset(__units_libcxx) diff --git a/test/unit_test/static/quantity_test.cpp b/test/unit_test/static/quantity_test.cpp index ac18c8e6..47447b46 100644 --- a/test/unit_test/static/quantity_test.cpp +++ b/test/unit_test/static/quantity_test.cpp @@ -273,7 +273,7 @@ static_assert(get_length_derived_quantity() == 1_q_m); // CTAD ///////// -#if UNITS_COMP_GCC >= 11 || UNITS_COMP_CLANG > 13 +#if UNITS_COMP_GCC >= 11 || UNITS_COMP_CLANG > 14 static_assert(std::is_same_v); static_assert(std::is_same_v); #endif