Exemple #1
0
    def __init__(self, conanfile):
        self._conanfile = conanfile
        self._build_type = conanfile.settings.get_safe("build_type")
        self._compiler = conanfile.settings.get_safe("compiler")
        self._compiler_version = conanfile.settings.get_safe(
            "compiler.version")
        self._compiler_runtime = conanfile.settings.get_safe(
            "compiler.runtime")
        self._shared = self._conanfile.options.get_safe("shared")
        self._fpic = self._deduce_fpic()

        self._libcxx_flag = libcxx_flag(conanfile.settings)
        self._cppstd_flag = cppstd_flag(conanfile.settings)
        self._skip_rpath = True if self._conanfile.settings.get_safe(
            "os") == "Macos" else False
        self._arch_flag = architecture_flag(self._conanfile.settings)
        self._build_type_flags = build_type_flags(self._conanfile.settings)

        self._os_host = conanfile.settings.get_safe("os")
        self._arch_host = conanfile.settings.get_safe("arch")
        self._os_target, self._arch_target = get_target_os_arch(conanfile)
        self._arch_build, self._os_build = self._get_build_os_arch()

        self._trip_build, self._trip_host, self._trip_target = self._get_host_build_target_flags(
        )

        self._build_type_define = build_type_define(
            build_type=self._build_type)
        self._glibcxx_define = libcxx_define(self._conanfile.settings)

        self.variables = {}
        self.preprocessor_definitions = {}
Exemple #2
0
    def __init__(self, conanfile, win_bash=False, include_rpath_flags=False):
        """
        FIXME: include_rpath_flags CONAN 2.0 to default True? Could break many packages in center
        """
        self._conanfile = conanfile
        self._win_bash = win_bash
        self._include_rpath_flags = include_rpath_flags
        self.subsystem = OSInfo().detect_windows_subsystem(
        ) if self._win_bash else None
        self._deps_cpp_info = conanfile.deps_cpp_info
        self._os = conanfile.settings.get_safe("os")
        self._os_version = conanfile.settings.get_safe("os.version")
        self._os_sdk = conanfile.settings.get_safe("os.sdk")
        self._os_subsystem = conanfile.settings.get_safe("os.subsystem")
        self._arch = conanfile.settings.get_safe("arch")
        self._os_target, self._arch_target = get_target_os_arch(conanfile)

        self._build_type = conanfile.settings.get_safe("build_type")

        self._compiler = conanfile.settings.get_safe("compiler")
        conan_v2_error("compiler setting should be defined.",
                       not self._compiler)

        self._compiler_version = conanfile.settings.get_safe(
            "compiler.version")
        self._compiler_runtime = conanfile.settings.get_safe(
            "compiler.runtime")
        self._libcxx = conanfile.settings.get_safe("compiler.libcxx")
        self._cppstd = cppstd_from_settings(conanfile.settings)

        # Set the generic objects before mapping to env vars to let the user
        # alter some value
        self.libs = list(self._deps_cpp_info.libs)
        self.libs.extend(list(self._deps_cpp_info.system_libs))
        self.include_paths = list(self._deps_cpp_info.include_paths)
        self.library_paths = list(self._deps_cpp_info.lib_paths)

        self.defines = self._configure_defines()
        # Will go to CFLAGS and CXXFLAGS ["-m64" "-m32", "-g", "-s"]
        self.flags = self._configure_flags()
        # Only c++ flags [-stdlib, -library], will go to CXXFLAGS
        self.cxx_flags = self._configure_cxx_flags()
        # cpp standard
        self.cppstd_flag = cppstd_flag(conanfile.settings)
        # Not -L flags, ["-m64" "-m32"]
        self.link_flags = self._configure_link_flags()  # TEST!
        # Precalculate -fPIC
        self.fpic = self._configure_fpic()

        # Precalculate build, host, target triplets
        self.build, self.host, self.target = self._get_host_build_target_flags(
        )
Exemple #3
0
    def __init__(self, conanfile):
        self._conanfile = conanfile

        self._set_libcxx = True
        self._set_cppstd = True
        self._set_arch = True
        self._set_shared = True if conanfile.options.get_safe(
            "shared") else False
        self._set_fpic = True if conanfile.options.get_safe("fPIC") else False

        self._compiler = conanfile.settings.get_safe("compiler")
        self._compiler_version = conanfile.settings.get_safe(
            "compiler.version")
        self._compiler_runtime = conanfile.settings.get_safe(
            "compiler.runtime")
        self._libcxx = conanfile.settings.get_safe("compiler.libcxx")

        # cpp standard
        self._cppstd = cppstd_from_settings(conanfile.settings)
        self._cppstd_flag = cppstd_flag(conanfile.settings)

        # arch_build in compiler flag format
        self._arch_flag = architecture_flag(self._conanfile.settings)

        # build_type information in compiler flag format
        self._build_type_flags = " ".join(
            build_type_flags(self._conanfile.settings))

        self._os_host = conanfile.settings.get_safe("os")
        self._arch_host = conanfile.settings.get_safe("arch")
        self._os_target, self._arch_target = get_target_os_arch(conanfile)
        self._arch_build, self._os_build = self._get_build_os_arch()
        self._build_type = conanfile.settings.get_safe("build_type")

        # Precalculate build, host, target triplets
        self._trip_build, self._trip_host, self._trip_target = self._get_host_build_target_flags(
        )

        self.definitions = {}