Пример #1
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.cppflags.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
Пример #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.cppflags.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
Пример #3
0
    def visual_studio_extensions_test(self):
        settings = Settings.loads(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.assertEquals('-O2 -Ob2 -DNDEBUG -link mylib.lib other.lib',
                          gen.content)