Esempio n. 1
0
    def _get_conanfile(settings, frameworks=False, system_libs=False):
        conan_file = ConanFileMock()
        conan_file.settings = settings
        conan_file.source_folder = "my_cache_source_folder"
        conan_file.build_folder = "my_cache_build_folder"
        conan_file.deps_env_info = DepsEnvInfo()
        conan_file.deps_user_info = DepsUserInfo()
        conan_file.deps_cpp_info = DepsCppInfo()
        cpp_info = CppInfo("/root")
        cpp_info.include_paths.append("path/to/include1")
        cpp_info.lib_paths.append("path/to/lib1")
        cpp_info.libs.append("mylib")
        cpp_info.bindirs = "path/to/bin1"
        cpp_info.cflags.append("c_flag1")
        cpp_info.cxxflags.append("cxx_flag1")
        cpp_info.defines.append("mydefine1")
        if system_libs:
            cpp_info.system_libs.append("system_lib1")
        if frameworks:
            cpp_info.frameworks = ["AVFoundation", "VideoToolbox"]
            cpp_info.framework_paths.extend(['path/to/Frameworks1', 'path/to/Frameworks2'])

        conan_file.deps_cpp_info.update(cpp_info, "zlib")
        conan_file.env_info = EnvInfo()
        return conan_file
Esempio n. 2
0
    def _get_conanfile(self, settings):
        conan_file = ConanFileMock()
        conan_file.settings = settings
        conan_file.source_folder = "my_cache_source_folder"
        conan_file.build_folder = "my_cache_build_folder"
        conan_file.deps_env_info = DepsEnvInfo()
        conan_file.deps_user_info = DepsUserInfo()
        conan_file.deps_cpp_info = DepsCppInfo()
        cpp_info = CppInfo("/root")
        cpp_info.include_paths.append("path/to/include1")
        cpp_info.lib_paths.append("path/to/lib1")
        cpp_info.libs.append("mylib")
        cpp_info.bindirs = "path/to/bin1"
        cpp_info.cflags.append("c_flag1")
        cpp_info.cxxflags.append("cxx_flag1")
        cpp_info.defines.append("mydefine1")

        conan_file.deps_cpp_info.update(cpp_info, "zlib")
        conan_file.env_info = EnvInfo()
        return conan_file
Esempio n. 3
0
    def visual_studio_extensions_test(self):
        settings = Settings.loads(get_default_settings_yml())
        settings.os = "Windows"
        settings.compiler = "Visual Studio"
        settings.compiler.version = "15"
        settings.arch = "x86"
        settings.build_type = "Release"

        conan_file = ConanFileMock()
        conan_file.settings = settings
        conan_file.deps_env_info = DepsEnvInfo()
        conan_file.deps_user_info = DepsUserInfo()
        conan_file.deps_cpp_info = DepsCppInfo()
        cpp_info = CppInfo("/root")
        cpp_info.libs.append("mylib")
        cpp_info.libs.append("other.lib")
        conan_file.deps_cpp_info.update(cpp_info, "zlib")
        conan_file.env_info = EnvInfo()

        gen = CompilerArgsGenerator(conan_file)
        self.assertEqual('-O2 -Ob2 -DNDEBUG -link mylib.lib other.lib', gen.content)