diff --git a/build.py b/build.py index 007032cd..528e0845 100644 --- a/build.py +++ b/build.py @@ -9,4 +9,6 @@ if __name__ == "__main__": build_policy = "outdated", upload_dependencies="all") builder.add_common_builds(pure_c=False) + for settings, options, env_vars, build_requires, reference in builder.items: + settings["cppstd"] = "20" builder.run() diff --git a/conanfile.py b/conanfile.py index 68973a28..25d8501c 100644 --- a/conanfile.py +++ b/conanfile.py @@ -43,7 +43,7 @@ class UnitsConan(ConanFile): url = "https://github.com/mpusz/units" description = "Physical Units library for C++" exports = ["LICENSE.md"] - settings = "os", "compiler", "build_type", "arch" + settings = "cppstd", "os", "compiler", "build_type", "arch" requires = ( "cmcstl2/2019.03.18@mpusz/stable", "gsl-lite/0.33.0@nonstd-lite/stable" @@ -55,6 +55,10 @@ class UnitsConan(ConanFile): } generators = "cmake" + def configure(self): + if self.settings.cppstd not in ["20", "gnu20"]: + raise ConanInvalidConfiguration("Library units requires at least C++20 support") + def _configure_cmake(self): cmake = CMake(self) if tools.get_env("CONAN_RUN_TESTS", False):