def configure(self): minimal_cpp_standard = "17" if self.settings.compiler.cppstd: tools.check_min_cppstd(self, minimal_cpp_standard) minimal_version = { "Visual Studio": "15.9", "gcc": "7", "clang": "5", "apple-clang": "10" } compiler = str(self.settings.compiler) if compiler not in minimal_version: self.output.warn( "%s recipe lacks information about the %s compiler standard version support" % (self.name, compiler)) self.output.warn( "%s requires a compiler that supports at least C++%s" % (self.name, minimal_cpp_standard)) return version = tools.Version(self.settings.compiler.version) if version < minimal_version[compiler]: raise ConanInvalidConfiguration( "%s requires a compiler that supports at least C++%s" % (self.name, minimal_cpp_standard))
def validate(self): if self.settings.get_safe("compiler.cppstd"): tools.check_min_cppstd(self, self._minimum_cpp_standard) os = self.settings.os if os not in ("Windows", "Linux"): msg = ("OS {} is not supported !!").format(os) raise ConanInvalidConfiguration(msg) compiler = self.settings.compiler try: min_version = self._minimum_compilers_version[str(compiler)] if tools.Version(compiler.version) < min_version: msg = ( "{} requires C++{} features which are not supported by compiler {} {} !!" ).format(self.name, self._minimum_cpp_standard, compiler, compiler.version) raise ConanInvalidConfiguration(msg) except KeyError: msg = ( "{} recipe lacks information about the {} compiler, " "support for the required C++{} features is assumed").format( self.name, compiler, self._minimum_cpp_standard) self.output.warn(msg)
def validate(self): if self.options.shared and self._is_msvc and "MT" in msvc_runtime_flag( self): raise ConanInvalidConfiguration( "gtest:shared=True with compiler=\"Visual Studio\" is not " "compatible with compiler.runtime=MT/MTd") if self.settings.compiler.get_safe("cppstd"): tools.check_min_cppstd(self, self._minimum_cpp_standard) def loose_lt_semver(v1, v2): lv1 = [int(v) for v in v1.split(".")] lv2 = [int(v) for v in v2.split(".")] min_length = min(len(lv1), len(lv2)) return lv1[:min_length] < lv2[:min_length] min_version = self._minimum_compilers_version.get( str(self.settings.compiler)) if min_version and loose_lt_semver(str(self.settings.compiler.version), min_version): raise ConanInvalidConfiguration( "{0} requires {1} {2}. The current compiler is {1} {3}.". format(self.name, self.settings.compiler, min_version, self.settings.compiler.version))
def validate(self): if self.settings.compiler.get_safe("cppstd"): tools.check_min_cppstd(self, self._minimum_cpp_standard) min_version = self._minimum_compilers_version.get( str(self.settings.compiler)) if not min_version: self.output.warn( "{} recipe lacks information about the {} compiler support.". format(self.name, self.settings.compiler)) else: if tools.Version(self.settings.compiler.version) < min_version: raise ConanInvalidConfiguration( "{} requires C++{} support. The current compiler {} {} does not support it." .format(self.name, self._minimum_cpp_standard, self.settings.compiler, self.settings.compiler.version)) if self.settings.os == "Windows": if ("MT" in self.settings.compiler.runtime and self.options.shared): # This combination leads to an fast-dds error when linking # linking dynamic '*.dll' and static MT runtime raise ConanInvalidConfiguration( "Mixing a dll {} library with a static runtime is a bad idea" .format(self.name))
def configure(self): # Detect if host or build context if self.options.options_from_context: settings_target = getattr(self, 'settings_target', None) self.options.flatc = settings_target is not None self.options.flatbuffers = settings_target is None del self.options.options_from_context if not self.options.flatbuffers: del self.options.header_only self._header_only = False else: self._header_only = self.options.header_only if (self.options.shared and self.options.flatbuffers) or self._header_only or ( not self.options.flatbuffers and self.options.flatc): del self.options.fPIC if self._header_only and not self.options.flatc: del self.options.shared if self.settings.compiler.cppstd: tools.check_min_cppstd(self, 11)
def validate(self): if self.options.fontconfiguration == "win32" and self.settings.os != "Windows": raise ConanInvalidConfiguration( "'win32' option of fontconfig is only available on Windows") # C++ standard required if self.settings.compiler.get_safe("cppstd"): tools.check_min_cppstd(self, 14) minimum_version = self._minimum_compilers_version.get( str(self.settings.compiler), False) if not minimum_version: self.output.warn( "C++14 support required. Your compiler is unknown. Assuming it supports C++14." ) elif tools.Version(self.settings.compiler.version) < minimum_version: raise ConanInvalidConfiguration( "C++14 support required, which your compiler does not support." ) if self.options.with_nss: # FIXME: missing nss recipe raise ConanInvalidConfiguration( "nss is not (yet) available on cci")
def configure(self): if self.options.shared: del self.options.fPIC if tools.Version(self.version) >= "1.51": if self.settings.compiler.cppstd: tools.check_min_cppstd(self, 11) def lazy_lt_semver(v1, v2): lv1 = [int(v) for v in v1.split(".")] lv2 = [int(v) for v in v2.split(".")] min_length = min(len(lv1), len(lv2)) return lv1[:min_length] < lv2[:min_length] minimum_version = self._min_compiler_version_default_cxx11 if not minimum_version: self.output.warn("geographiclib {} requires C++11 math functions. Your compiler is unknown. Assuming it supports this feature.".format(self.version)) elif lazy_lt_semver(str(self.settings.compiler.version), minimum_version): raise ConanInvalidConfiguration("geographiclib {} requires C++11 math functions, which your compiler does not support.".format(self.version)) if self.options.precision not in ["float", "double"]: # FIXME: add support for extended, quadruple and variable precisions # (may require external libs: boost multiprecision for quadruple, mpfr for variable) raise ConanInvalidConfiguration("extended, quadruple and variable precisions not yet supported in this recipe")
def validate(self): compiler = self.settings.compiler version = tools.Version(self.settings.compiler.version) if compiler.get_safe("cppstd"): tools.check_min_cppstd(self, 14) if compiler == "Visual Studio": if version < "16": raise ConanInvalidConfiguration( "Iceoryx is just supported for Visual Studio 2019 and higher." ) if self.options.shared: raise ConanInvalidConfiguration( 'Using Iceoryx with Visual Studio currently just possible with "shared=False"' ) elif compiler == "gcc": if version < "6": raise ConanInvalidConfiguration( "Using Iceoryx with gcc requires gcc 6 or higher.") if version < "9" and compiler.get_safe("libcxx") == "libstdc++": raise ConanInvalidConfiguration( "gcc < 9 with libstdc++ not supported") if version == "6": self.output.warn( "Iceoryx package is compiled with gcc 6, it is recommended to use 7 or higher" ) self.output.warn("GCC 6 will build with warnings.") elif compiler == "clang": if compiler.get_safe("libcxx") == "libstdc++": raise ConanInvalidConfiguration( "clang with libstdc++ not supported") if version == "7.0" and compiler.get_safe("libcxx") == "libc++" and \ self.options.shared and self.settings.build_type == "Debug": raise ConanInvalidConfiguration( "shared Debug with clang 7.0 and libc++ not supported")
def validate(self): if self.settings.compiler.get_safe("cppstd"): tools.check_min_cppstd(self, self._minimum_cpp_standard) def lazy_lt_semver(v1, v2): lv1 = [int(v) for v in v1.split(".")] lv2 = [int(v) for v in v2.split(".")] min_length = min(len(lv1), len(lv2)) return lv1[:min_length] < lv2[:min_length] min_version = self._minimum_compilers_version.get( str(self.settings.compiler)) if not min_version: self.output.warn( "{} recipe lacks information about the {} compiler support.". format(self.name, self.settings.compiler)) else: if lazy_lt_semver(str(self.settings.compiler.version), min_version): raise ConanInvalidConfiguration( "{} requires C++{} support. The current compiler {} {} does not support it." .format(self.name, self._minimum_cpp_standard, self.settings.compiler, self.settings.compiler.version))
def configure(self): supported_archs = [ "x86", "x86_64", "armv6", "armv7", "armv7hf", "armv8" ] if not any(arch in str(self.settings.arch) for arch in supported_archs): raise ConanInvalidConfiguration("{} is not supported by {}".format( self.settings.arch, self.name)) if self.settings.compiler.cppstd: tools.check_min_cppstd(self, "14") minimum_version = self._compilers_minimum_version.get( str(self.settings.compiler), False) if minimum_version: if tools.Version(self.settings.compiler.version) < minimum_version: raise ConanInvalidConfiguration( "Quill requires C++14, which your compiler does not support." ) else: self.output.warn( "Quill requires C++14. Your compiler is unknown. Assuming it supports C++14." )
def validate(self): minimal_cpp_standard = "17" if self.settings.compiler.get_safe("cppstd"): tools.check_min_cppstd(self, minimal_cpp_standard) minimal_version = { "gcc": "7", "clang": "6", "apple-clang": "10", "Visual Studio": "15" } compiler = str(self.settings.compiler) if compiler not in minimal_version: self.output.warn( "%s recipe lacks information about the %s compiler standard version support" % (self.name, compiler)) self.output.warn( "%s requires a compiler that supports at least C++%s" % (self.name, minimal_cpp_standard)) return compiler_version = tools.Version(self.settings.compiler.version) if compiler_version < minimal_version[compiler]: raise ConanInvalidConfiguration("%s requires a compiler that supports at least C++%s" % (self.name, minimal_cpp_standard)) if self.options.shared: raise ConanInvalidConfiguration("shared option is currently not supported")
def configure(self): if self.options.shared: del self.options.fPIC if self.settings.compiler.cppstd: tools.check_min_cppstd(self, 11) # Check compiler version compiler = str(self.settings.compiler) compiler_version = tools.Version(self.settings.compiler.version.value) minimal_version = { "Visual Studio": "15", "gcc": "5", "clang": "5", "apple-clang": "6" } if compiler not in minimal_version: self.output.warn( "%s recipe lacks information about the %s compiler standard version support" % (self.name, compiler)) elif compiler_version < minimal_version[compiler]: raise ConanInvalidConfiguration( "{} requires a {} version >= {}".format( self.name, compiler, compiler_version))
def validate(self): if self._is_msvc: if self.settings.compiler == "Visual Studio": vs_ide_version = self.settings.compiler.version else: vs_ide_version = tools.microsoft.visual.msvc_version_to_vs_ide_version( self.settings.compiler.version) if Version(vs_ide_version) < "14": raise ConanInvalidConfiguration( "gRPC can only be built with Visual Studio 2015 or higher." ) if self.options.shared: raise ConanInvalidConfiguration( "gRPC shared not supported yet with Visual Studio") if Version(self.version ) >= "1.47" and self.settings.compiler == "gcc" and Version( self.settings.compiler.version) < "6": raise ConanInvalidConfiguration( "GCC older than 6 is not supported") if self.settings.compiler.get_safe("cppstd"): tools_legacy.check_min_cppstd(self, self._cxxstd_required)
def validate(self): if self.settings.compiler.get_safe("cppstd"): tools.check_min_cppstd(self, self._minimum_cpp_standard) if tools.Version( self.version) <= "1.1.8" and self.settings.compiler in [ "msvc", "Visual Studio" ]: raise ConanInvalidConfiguration( "{} version 1.1.8 may not be built with MSVC. " "Please use at least version 1.1.9 with MSVC.") min_version = self._minimum_compilers_version.get( str(self.settings.compiler)) if not min_version: self.output.warn("{} recipe lacks information about the {} " "compiler support.".format( self.name, self.settings.compiler)) else: if tools.Version(self.settings.compiler.version) < min_version: raise ConanInvalidConfiguration( "{} requires C++{} support. " "The current compiler {} {} does not support it.".format( self.name, self._minimum_cpp_standard, self.settings.compiler, self.settings.compiler.version))
def configure(self): if self.settings.get_safe("compiler.cppstd"): tools.check_min_cppstd(self, self._minimum_cpp_standard) min_version = self._minimum_compilers_version.get( str(self.settings.compiler)) if not min_version: self.output.warn( "{} recipe lacks information about the {} compiler support.". format(self.name, self.settings.compiler)) else: if tools.Version(self.settings.compiler.version) < min_version: raise ConanInvalidConfiguration( "{} requires C++17 support. The current compiler {} {} does not support it." .format(self.name, self.settings.compiler, self.settings.compiler.version)) if self.options.with_fs and str( self.settings.compiler) == "apple-clang": raise ConanInvalidConfiguration( "apple-clang 11 is currently not support with filesystem") if self.options.shared: raise ConanInvalidConfiguration( "shared is currently not supported")
def validate(self): if self.settings.compiler.get_safe("cppstd"): if tools.Version(self.version) >= "1.3.0": tools.check_min_cppstd(self, 17) else: tools.check_min_cppstd(self, 11) if tools.Version(self.version) >= "1.3.0": minimum_version = self._compiler_required_cpp17.get( str(self.settings.compiler), False) if minimum_version: if tools.Version( self.settings.compiler.version) < minimum_version: raise ConanInvalidConfiguration( "{} requires C++17, which your compiler does not support." .format(self.name)) else: self.output.warn( "{0} requires C++17. Your compiler is unknown. Assuming it supports C++17." .format(self.name)) if self.options.with_tls != self.options["hiredis"].with_ssl: raise ConanInvalidConfiguration( "with_tls must match hiredis.with_ssl option")
def validate(self): if tools.is_apple_os(self.settings.os): raise ConanInvalidConfiguration( "{} does not support Apple platform".format(self.name)) if self.settings.compiler.get_safe("cppstd"): tools.check_min_cppstd(self, 17) minimum_version = self._compiler_required_cpp17.get( str(self.settings.compiler), False) if minimum_version: if tools.Version(self.settings.compiler.version) < minimum_version: raise ConanInvalidConfiguration( "{} requires C++17, which your compiler does not support.". format(self.name)) else: self.output.warn( "{0} requires C++17. Your compiler is unknown. Assuming it supports C++17." .format(self.name)) if self.settings.compiler == "clang" and self.settings.compiler.get_safe( "libcxx") == "libc++": raise ConanInvalidConfiguration( "{} doesn't support clang with libc++".format(self.name))
def validate(self): if self.settings.compiler.get_safe("cppstd"): tools.check_min_cppstd(self, "20") if self.options.shared and is_msvc(self): # see https://github.com/David-Haim/concurrencpp/issues/75 raise ConanInvalidConfiguration( "concurrencpp does not support shared builds with Visual Studio" ) if self.settings.compiler == "gcc": raise ConanInvalidConfiguration( "gcc is not supported by concurrencpp") minimum_version = self._minimum_compilers_version.get( str(self.settings.compiler), False) if not minimum_version: self.output.warn( "concurrencpp requires C++20. Your compiler is unknown. Assuming it supports C++20." ) elif tools.Version(self.settings.compiler.version) < minimum_version: raise ConanInvalidConfiguration( "concurrencpp requires clang >= 11 or Visual Studio >= 16.8.2 as a compiler!" ) if self.settings.compiler == "clang" and self.settings.compiler.libcxx != "libc++": raise ConanInvalidConfiguration("libc++ required")
def validate(self): if self.settings.compiler.cppstd: tools.check_min_cppstd(self, 11)
def configure(self): if self.settings.compiler.get_safe("cppstd"): tools.check_min_cppstd(self, '11')
def configure(self): if self.settings.compiler.cppstd: tools.check_min_cppstd(self, "11")
def validate(self): if self.settings.compiler.get_safe("cppstd"): tools.check_min_cppstd(self, 11)
def configure(self): if self.options.shared: del self.options.fPIC if self.settings.compiler.cppstd: tools.check_min_cppstd(self, "11")
def configure(self): tools.check_min_cppstd(self, "17")
def configure(self): tools.check_min_cppstd(self, "17") if self.options.tests: # We have our own main function, # Moreover, if "shared" is True then main is an .so... self.options["gtest"].no_main = True
def validate(self): if self.settings.compiler.cppstd: tools.check_min_cppstd(self, 11) miss_boost_required_comp = any(getattr(self.options["boost"], "without_{}".format(boost_comp), True) for boost_comp in self._required_boost_components) if self.options["boost"].header_only or miss_boost_required_comp: raise ConanInvalidConfiguration("{0} requires non header-only boost with these components: {1}".format(self.name, ", ".join(self._required_boost_components)))
def configure(self): if self.settings.compiler.cppstd: tools.check_min_cppstd(self, 11) lower_build_type = str(self.settings.build_type).lower()
def validate(self): if self.settings.compiler == "gcc" and tools.Version( self.settings.compiler.version) < 7: raise ConanInvalidConfiguration("perfetto requires gcc >= 7") if self.settings.compiler.cppstd: tools.check_min_cppstd(self, 11)
def configure(self): # C++ minimum standard required if self.settings.compiler.get_safe("cppstd"): tools.check_min_cppstd(self, 17) minimum_version = self._minimum_compilers_version.get(str(self.settings.compiler), False) if not minimum_version: self.output.warn("C++17 support required. Your compiler is unknown. Assuming it supports C++17.") elif tools.Version(self.settings.compiler.version) < minimum_version: raise ConanInvalidConfiguration("C++17 support required, which your compiler does not support.") if self.options.widgets and not self.options.gui: raise ConanInvalidConfiguration("using option qt:widgets without option qt:gui is not possible. " "You can either disable qt:widgets or enable qt:gui") if not self.options.gui: del self.options.opengl del self.options.with_vulkan del self.options.with_freetype del self.options.with_fontconfig del self.options.with_harfbuzz del self.options.with_libjpeg del self.options.with_libpng if self.settings.os == "Android" and self.options.get_safe("opengl", "no") == "desktop": raise ConanInvalidConfiguration("OpenGL desktop is not supported on Android.") if self.settings.os != "Windows" and self.options.get_safe("opengl", "no") == "dynamic": raise ConanInvalidConfiguration("Dynamic OpenGL is supported only on Windows.") if self.options.get_safe("with_fontconfig", False) and not self.options.get_safe("with_freetype", False): raise ConanInvalidConfiguration("with_fontconfig cannot be enabled if with_freetype is disabled.") if self.options.multiconfiguration: del self.settings.build_type if "MT" in self.settings.get_safe("compiler.runtime", default="") and self.options.shared: raise ConanInvalidConfiguration("Qt cannot be built as shared library with static runtime") config = configparser.ConfigParser() config.read(os.path.join(self.recipe_folder, "qtmodules%s.conf" % self.version)) submodules_tree = {} assert config.sections() for s in config.sections(): section = str(s) assert section.startswith("submodule ") assert section.count('"') == 2 modulename = section[section.find('"') + 1: section.rfind('"')] status = str(config.get(section, "status")) if status not in ["obsolete", "ignore", "additionalLibrary"]: submodules_tree[modulename] = {"status": status, "path": str(config.get(section, "path")), "depends": []} if config.has_option(section, "depends"): submodules_tree[modulename]["depends"] = [str(i) for i in config.get(section, "depends").split()] for m in submodules_tree: assert(m in ["qtbase", "qtqa", "qtrepotools"] or m in self._submodules) for m in self._submodules: assert(m in submodules_tree) def _enablemodule(mod): if mod != "qtbase": setattr(self.options, mod, True) for req in submodules_tree[mod]["depends"]: _enablemodule(req) for module in self._submodules: if self.options.get_safe(module): _enablemodule(module)
def validate(self): if self.settings.compiler.get_safe("cppstd"): tools.check_min_cppstd(self, 11) minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) if minimum_version and tools.Version(self.settings.compiler.version) < minimum_version: raise ConanInvalidConfiguration("{} {} requires several C++11 features, which your compiler does not support.".format(self.name, self.version))