def __init__(self, conanfile): self._conanfile = conanfile build_type = self._conanfile.settings.get_safe("build_type") # TODO: compiler.runtime for Visual studio? # defines self.ndebug = None if build_type in ['Release', 'RelWithDebInfo', 'MinSizeRel']: self.ndebug = "NDEBUG" self.gcc_cxx11_abi = self._cxx11_abi_define() self.defines = [] # cxxflags, cflags self.cxxflags = [] self.cflags = [] self.ldflags = [] self.libcxx = self._libcxx() self.fpic = self._conanfile.options.get_safe("fPIC") # FIXME: This needs to be imported here into conan.tools self.cppstd = cppstd_flag_new(self._conanfile.settings) self.arch_flag = architecture_flag(self._conanfile.settings) # TODO: This is also covering compilers like Visual Studio, necessary to test it (&remove?) self.build_type_flags = build_type_flags(self._conanfile.settings) self._host = None self._build = None self._target = None if _cross_building(self._conanfile): os_build, arch_build, os_host, arch_host = _get_cross_building_settings( self._conanfile) self._host = _get_gnu_triplet(os_host, arch_host) self._build = _get_gnu_triplet(os_build, arch_build)
def __init__(self, conanfile, namespace=None): self._conanfile = conanfile self._namespace = namespace build_type = self._conanfile.settings.get_safe("build_type") self.configure_args = [] self.make_args = [] self.default_configure_install_args = False # TODO: compiler.runtime for Visual studio? # defines self.ndebug = None if build_type in ['Release', 'RelWithDebInfo', 'MinSizeRel']: self.ndebug = "NDEBUG" self.gcc_cxx11_abi = self._cxx11_abi_define() self.defines = [] # cxxflags, cflags self.cxxflags = [] self.cflags = [] self.ldflags = [] self.libcxx = self._libcxx() self.fpic = self._conanfile.options.get_safe("fPIC") self.cppstd = cppstd_flag(self._conanfile.settings) self.arch_flag = architecture_flag(self._conanfile.settings) # TODO: This is also covering compilers like Visual Studio, necessary to test it (&remove?) self.build_type_flags = build_type_flags(self._conanfile.settings) # Cross build self._host = None self._build = None self._target = None self.apple_arch_flag = self.apple_isysroot_flag = None self.apple_min_version_flag = apple_min_version_flag(self._conanfile) if cross_building(self._conanfile): os_build, arch_build, os_host, arch_host = get_cross_building_settings( self._conanfile) self._host = _get_gnu_triplet(os_host, arch_host) self._build = _get_gnu_triplet(os_build, arch_build) # Apple Stuff if os_build == "Macos": sdk_path = apple_sdk_path(conanfile) apple_arch = to_apple_arch( self._conanfile.settings.get_safe("arch")) # https://man.archlinux.org/man/clang.1.en#Target_Selection_Options self.apple_arch_flag = "-arch {}".format( apple_arch) if apple_arch else None # -isysroot makes all includes for your library relative to the build directory self.apple_isysroot_flag = "-isysroot {}".format( sdk_path) if sdk_path else None check_using_build_profile(self._conanfile)