Пример #1
0
    def test_sysroot_flag(self):
        sysroot = sysroot_flag(sysroot=None)
        self.assertEquals(sysroot, "")

        sysroot = sysroot_flag(sysroot='sys/root', compiler='Visual Studio')
        self.assertEquals(sysroot, "")

        sysroot = sysroot_flag(sysroot='sys/root')
        self.assertEquals(sysroot, "--sysroot=sys/root")
Пример #2
0
    def test_sysroot_flag(self):
        sysroot = sysroot_flag(sysroot=None)
        self.assertEquals(sysroot, "")

        sysroot = sysroot_flag(sysroot='sys/root', compiler='Visual Studio')
        self.assertEquals(sysroot, "")

        sysroot = sysroot_flag(sysroot='sys/root')
        self.assertEquals(sysroot, "--sysroot=sys/root")
Пример #3
0
    def test_sysroot_flag(self):
        sysroot = sysroot_flag(sysroot=None, settings=MockSettings({}))
        self.assertEqual(sysroot, "")

        sysroot = sysroot_flag(sysroot='sys/root',
                               settings=MockSettings({"compiler": "Visual Studio"}))
        self.assertEqual(sysroot, "")

        sysroot = sysroot_flag(sysroot='sys/root', settings=MockSettings({}))
        self.assertEqual(sysroot, "--sysroot=sys/root")
Пример #4
0
    def _configure_link_flags(self):
        """Not the -L"""
        ret = copy.copy(self._deps_cpp_info.sharedlinkflags)
        ret.extend(self._deps_cpp_info.exelinkflags)
        ret.extend(
            format_frameworks(self._deps_cpp_info.frameworks,
                              self._conanfile.settings))
        ret.extend(
            format_framework_paths(self._deps_cpp_info.framework_paths,
                                   self._conanfile.settings))
        arch_flag = architecture_flag(self._conanfile.settings)
        if arch_flag:
            ret.append(arch_flag)

        sysf = sysroot_flag(self._deps_cpp_info.sysroot,
                            self._conanfile.settings,
                            win_bash=self._win_bash,
                            subsystem=self.subsystem)
        if sysf:
            ret.append(sysf)

        if self._include_rpath_flags:
            os_build, _ = get_build_os_arch(self._conanfile)
            if not hasattr(self._conanfile, 'settings_build'):
                os_build = os_build or self._os
            ret.extend(
                rpath_flags(self._conanfile.settings, os_build,
                            self._deps_cpp_info.lib_paths))

        return ret
Пример #5
0
    def _configure_link_flags(self):
        """Not the -L"""
        ret = copy.copy(self._deps_cpp_info.sharedlinkflags)
        ret.extend(self._deps_cpp_info.exelinkflags)
        ret.extend(
            format_frameworks(self._deps_cpp_info.frameworks,
                              compiler=self._compiler))
        ret.extend(
            format_framework_paths(self._deps_cpp_info.framework_paths,
                                   compiler=self._compiler))
        arch_flag = architecture_flag(compiler=self._compiler,
                                      os=self._os,
                                      arch=self._arch)
        if arch_flag:
            ret.append(arch_flag)

        sysf = sysroot_flag(self._deps_cpp_info.sysroot,
                            win_bash=self._win_bash,
                            subsystem=self.subsystem,
                            compiler=self._compiler)
        if sysf:
            ret.append(sysf)

        if self._include_rpath_flags:
            the_os = self._conanfile.settings.get_safe("os_build") or self._os
            ret.extend(
                rpath_flags(the_os, self._compiler,
                            self._deps_cpp_info.lib_paths))

        return ret
Пример #6
0
    def content(self):
        """With compiler_args you can invoke your compiler:
        $ gcc main.c @conanbuildinfo.args -o main
        $ clang main.c @conanbuildinfo.args -o main
        $ cl /EHsc main.c @conanbuildinfo.args
        """
        flags = []
        flags.extend(format_defines(self._deps_build_info.defines))
        flags.extend(format_include_paths(self._deps_build_info.include_paths,
                                          compiler=self.compiler))

        flags.extend(self._deps_build_info.cxxflags)
        flags.extend(self._deps_build_info.cflags)

        arch_flag = architecture_flag(arch=self.conanfile.settings.get_safe("arch"),
                                      os=self.conanfile.settings.get_safe("os"),
                                      compiler=self.compiler)
        if arch_flag:
            flags.append(arch_flag)

        build_type = self.conanfile.settings.get_safe("build_type")
        btfs = build_type_flags(compiler=self.compiler, build_type=build_type,
                                vs_toolset=self.conanfile.settings.get_safe("compiler.toolset"))
        if btfs:
            flags.extend(btfs)
        btd = build_type_define(build_type=build_type)
        if btd:
            flags.extend(format_defines([btd]))

        if self.compiler == "Visual Studio":
            runtime = visual_runtime(self.conanfile.settings.get_safe("compiler.runtime"))
            if runtime:
                flags.append(runtime)
            # Necessary in the "cl" invocation before specify the rest of linker flags
            flags.append(visual_linker_option_separator)

        os_build, _ = get_build_os_arch(self.conanfile)
        if not hasattr(self.conanfile, 'settings_build'):
            os_build = os_build or self.conanfile.settings.get_safe("os")

        flags.extend(rpath_flags(os_build, self.compiler, self._deps_build_info.lib_paths))
        flags.extend(format_library_paths(self._deps_build_info.lib_paths, compiler=self.compiler))
        flags.extend(format_libraries(self._deps_build_info.libs, compiler=self.compiler))
        flags.extend(format_libraries(self._deps_build_info.system_libs, compiler=self.compiler))
        flags.extend(self._deps_build_info.sharedlinkflags)
        flags.extend(self._deps_build_info.exelinkflags)
        flags.extend(self._libcxx_flags())
        flags.extend(format_frameworks(self._deps_build_info.frameworks, compiler=self.compiler))
        flags.extend(format_framework_paths(self._deps_build_info.framework_paths,
                                            compiler=self.compiler))
        flags.append(cppstd_flag(self.conanfile.settings))
        sysrf = sysroot_flag(self._deps_build_info.sysroot, compiler=self.compiler)
        if sysrf:
            flags.append(sysrf)

        return " ".join(flag for flag in flags if flag)
Пример #7
0
    def content(self):
        """With compiler_args you can invoke your compiler:
        $ gcc main.c @conanbuildinfo.args -o main
        $ clang main.c @conanbuildinfo.args -o main
        $ cl /EHsc main.c @conanbuildinfo.args
        """
        flags = []
        flags.extend(format_defines(self._deps_build_info.defines))
        flags.extend(format_include_paths(self._deps_build_info.include_paths, compiler=self.compiler))

        flags.extend(self._deps_build_info.cppflags)
        flags.extend(self._deps_build_info.cflags)

        arch_flag = architecture_flag(arch=self.conanfile.settings.get_safe("arch"), compiler=self.compiler)
        if arch_flag:
            flags.append(arch_flag)

        build_type = self.conanfile.settings.get_safe("build_type")
        btfs = build_type_flags(compiler=self.compiler, build_type=build_type,
                                vs_toolset=self.conanfile.settings.get_safe("compiler.toolset"))
        if btfs:
            flags.extend(btfs)
        btd = build_type_define(build_type=build_type)
        if btd:
            flags.extend(format_defines([btd]))

        if self.compiler == "Visual Studio":
            runtime = visual_runtime(self.conanfile.settings.get_safe("compiler.runtime"))
            if runtime:
                flags.append(runtime)
            # Necessary in the "cl" invocation before specify the rest of linker flags
            flags.append(visual_linker_option_separator)

        the_os = (self.conanfile.settings.get_safe("os_build") or
                  self.conanfile.settings.get_safe("os"))
        flags.extend(rpath_flags(the_os, self.compiler, self._deps_build_info.lib_paths))
        flags.extend(format_library_paths(self._deps_build_info.lib_paths, compiler=self.compiler))
        flags.extend(format_libraries(self._deps_build_info.libs, compiler=self.compiler))
        flags.extend(self._deps_build_info.sharedlinkflags)
        flags.extend(self._deps_build_info.exelinkflags)
        flags.extend(self._libcxx_flags())
        flags.append(cppstd_flag(self.conanfile.settings.get_safe("compiler"),
                                 self.conanfile.settings.get_safe("compiler.version"),
                                 self.conanfile.settings.get_safe("cppstd")))
        sysrf = sysroot_flag(self._deps_build_info.sysroot, compiler=self.compiler)
        if sysrf:
            flags.append(sysrf)

        return " ".join(flag for flag in flags if flag)
Пример #8
0
    def _configure_flags(self):
        ret = copy.copy(self._deps_cpp_info.cflags)
        arch_flag = architecture_flag(compiler=self._compiler, arch=self._arch)
        if arch_flag:
            ret.append(arch_flag)
        btfs = build_type_flags(compiler=self._compiler, build_type=self._build_type,
                                vs_toolset=self._conanfile.settings.get_safe("compiler.toolset"))
        if btfs:
            ret.extend(btfs)
        srf = sysroot_flag(self._deps_cpp_info.sysroot, win_bash=self._win_bash,
                           subsystem=self.subsystem,
                           compiler=self._compiler)
        if srf:
            ret.append(srf)

        return ret
Пример #9
0
    def _configure_flags(self):
        ret = copy.copy(self._deps_cpp_info.cflags)
        arch_flag = architecture_flag(compiler=self._compiler, arch=self._arch)
        if arch_flag:
            ret.append(arch_flag)
        btfs = build_type_flags(compiler=self._compiler, build_type=self._build_type,
                                vs_toolset=self._conanfile.settings.get_safe("compiler.toolset"))
        if btfs:
            ret.extend(btfs)
        srf = sysroot_flag(self._deps_cpp_info.sysroot, win_bash=self._win_bash,
                           subsystem=self.subsystem,
                           compiler=self._compiler)
        if srf:
            ret.append(srf)

        return ret
Пример #10
0
    def _configure_flags(self):
        ret = copy.copy(self._deps_cpp_info.cflags)
        arch_flag = architecture_flag(compiler=self._compiler, arch=self._arch)
        if arch_flag:
            ret.append(arch_flag)
        btf = build_type_flag(compiler=self._compiler,
                              build_type=self._build_type)
        if btf:
            ret.append(btf)
        srf = sysroot_flag(self._deps_cpp_info.sysroot,
                           win_bash=self._win_bash,
                           subsystem=self.subsystem,
                           compiler=self._compiler)
        if srf:
            ret.append(srf)

        return ret
Пример #11
0
    def _configure_flags(self):
        ret = copy.copy(self._deps_cpp_info.cflags)
        arch_flag = architecture_flag(self._conanfile.settings)
        if arch_flag:
            ret.append(arch_flag)
        btfs = build_type_flags(self._conanfile.settings)
        if btfs:
            ret.extend(btfs)
        srf = sysroot_flag(self._deps_cpp_info.sysroot,
                           self._conanfile.settings,
                           win_bash=self._win_bash,
                           subsystem=self.subsystem)
        if srf:
            ret.append(srf)
        if self._compiler_runtime:
            ret.append("-%s" % self._compiler_runtime)

        return ret
Пример #12
0
    def _configure_link_flags(self):
        """Not the -L"""
        ret = copy.copy(self._deps_cpp_info.sharedlinkflags)
        ret.extend(self._deps_cpp_info.exelinkflags)
        arch_flag = architecture_flag(compiler=self._compiler, arch=self._arch)
        if arch_flag:
            ret.append(arch_flag)

        sysf = sysroot_flag(self._deps_cpp_info.sysroot, win_bash=self._win_bash,
                            subsystem=self.subsystem,
                            compiler=self._compiler)
        if sysf:
            ret.append(sysf)

        if self._include_rpath_flags:
            the_os = self._conanfile.settings.get_safe("os_build") or \
                 self._conanfile.settings.get_safe("os")
            ret.extend(rpath_flags(the_os, self._compiler, self._deps_cpp_info.lib_paths))

        return ret
Пример #13
0
    def content(self):
        """With compiler_args you can invoke your compiler:
        $ gcc main.c @conanbuildinfo.args -o main
        $ clang main.c @conanbuildinfo.args -o main
        $ cl /EHsc main.c @conanbuildinfo.args
        """
        flags = []
        flags.extend(
            format_defines(self._deps_build_info.defines,
                           compiler=self.compiler))
        flags.extend(
            format_include_paths(self._deps_build_info.include_paths,
                                 compiler=self.compiler))

        flags.extend(self._deps_build_info.cppflags)
        flags.extend(self._deps_build_info.cflags)

        arch_flag = architecture_flag(
            arch=self.conanfile.settings.get_safe("arch"),
            compiler=self.compiler)
        if arch_flag:
            flags.append(arch_flag)

        build_type = self.conanfile.settings.get_safe("build_type")
        btf = build_type_flag(compiler=self.compiler, build_type=build_type)
        if btf:
            flags.append(btf)
        btd = build_type_define(build_type=build_type)
        if btd:
            flags.extend(format_defines([btd], self.compiler))

        if self.compiler == "Visual Studio":
            runtime = visual_runtime(
                self.conanfile.settings.get_safe("compiler.runtime"))
            if runtime:
                flags.append(runtime)
            # Necessary in the "cl" invocation before specify the rest of linker flags
            flags.append(visual_linker_option_separator)

        the_os = self.conanfile.settings.get_safe("os_build") or \
                 self.conanfile.settings.get_safe("os")
        flags.extend(
            rpath_flags(the_os, self.compiler,
                        self._deps_build_info.lib_paths))
        flags.extend(
            format_library_paths(self._deps_build_info.lib_paths,
                                 compiler=self.compiler))
        flags.extend(
            format_libraries(self._deps_build_info.libs,
                             compiler=self.compiler))
        flags.extend(self._deps_build_info.sharedlinkflags)
        flags.extend(self._deps_build_info.exelinkflags)
        flags.extend(self._libcxx_flags())
        flags.extend(
            cppstd_flag(self.conanfile.settings.get_safe("compiler"),
                        self.conanfile.settings.get_safe("compiler.version"),
                        self.conanfile.settings.get_safe("cppstd")))
        sysrf = sysroot_flag(self._deps_build_info.sysroot,
                             compiler=self.compiler)
        if sysrf:
            flags.append(sysrf)

        return " ".join(flag for flag in flags if flag)