Skip to content
This repository has been archived by the owner on Jun 24, 2020. It is now read-only.

Commit

Permalink
Merge pull request #7 from bincrafters/testing/3.5.2
Browse files Browse the repository at this point in the history
#381 Minor refinement
  • Loading branch information
SSE4 authored Aug 1, 2018
2 parents a777456 + 1bce9a2 commit 21b67ec
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 9 deletions.
11 changes: 11 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ matrix:
env: CONAN_GCC_VERSIONS=7 CONAN_DOCKER_IMAGE=lasote/conangcc7 CONAN_ARCHS=x86
- <<: *linux
env: CONAN_GCC_VERSIONS=7 CONAN_DOCKER_IMAGE=lasote/conangcc7 CONAN_ARCHS=x86_64
- <<: *linux
env: CONAN_GCC_VERSIONS=8 CONAN_DOCKER_IMAGE=lasote/conangcc8 CONAN_ARCHS=x86
- <<: *linux
env: CONAN_GCC_VERSIONS=8 CONAN_DOCKER_IMAGE=lasote/conangcc8 CONAN_ARCHS=x86_64
- <<: *linux
env: CONAN_CLANG_VERSIONS=3.9 CONAN_DOCKER_IMAGE=lasote/conanclang39 CONAN_ARCHS=x86
- <<: *linux
Expand All @@ -38,6 +42,10 @@ matrix:
env: CONAN_CLANG_VERSIONS=5.0 CONAN_DOCKER_IMAGE=lasote/conanclang50 CONAN_ARCHS=x86
- <<: *linux
env: CONAN_CLANG_VERSIONS=5.0 CONAN_DOCKER_IMAGE=lasote/conanclang50 CONAN_ARCHS=x86_64
- <<: *linux
env: CONAN_CLANG_VERSIONS=6.0 CONAN_DOCKER_IMAGE=lasote/conanclang60 CONAN_ARCHS=x86
- <<: *linux
env: CONAN_CLANG_VERSIONS=6.0 CONAN_DOCKER_IMAGE=lasote/conanclang60 CONAN_ARCHS=x86_64
- <<: *osx
osx_image: xcode7.3
env: CONAN_APPLE_CLANG_VERSIONS=7.3
Expand All @@ -47,6 +55,9 @@ matrix:
- <<: *osx
osx_image: xcode9
env: CONAN_APPLE_CLANG_VERSIONS=9.0
- <<: *osx
osx_image: xcode9.3
env: CONAN_APPLE_CLANG_VERSIONS=9.1

install:
- chmod +x .travis/install.sh
Expand Down
17 changes: 8 additions & 9 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class ProtobufConan(ConanFile):
name = "protobuf"
version = "3.5.2"
url = "https://github.com/bincrafters/conan-protobuf"
homepage = "https://developers.google.com/protocol-buffers/"
homepage = "https://github.com/google/protobuf"
author = "Bincrafters <[email protected]>"
description = "Protocol Buffers - Google's data interchange format"
license = "BSD"
Expand All @@ -19,15 +19,17 @@ class ProtobufConan(ConanFile):
source_subfolder = "source_subfolder"
build_subfolder = "build_subfolder"
settings = "os", "arch", "compiler", "build_type"
short_paths=True
short_paths = True
options = {
"shared": [True, False],
"with_zlib": [True, False],
"fPIC": [True, False],
}
default_options = (
"with_zlib=False",
"shared=False", "fPIC=True")
"shared=False",
"fPIC=True"
)

def configure(self):
if self.settings.compiler == 'Visual Studio':
Expand All @@ -38,8 +40,7 @@ def requirements(self):
self.requires("zlib/1.2.11@conan/stable")

def source(self):
source_url = "https://github.com/google/protobuf"
tools.get("{0}/archive/v{1}.tar.gz".format(source_url, self.version))
tools.get("{0}/archive/v{1}.tar.gz".format(self.homepage, self.version))
extracted_dir = self.name + "-" + self.version
os.rename(extracted_dir, self.source_subfolder)

Expand All @@ -48,9 +49,7 @@ def configure_cmake(self):
cmake.definitions["CMAKE_INSTALL_LIBDIR"] = "lib"
cmake.definitions["protobuf_BUILD_TESTS"] = False
cmake.definitions["protobuf_WITH_ZLIB"] = self.options.with_zlib
if self.settings.compiler != 'Visual Studio':
cmake.definitions["CMAKE_POSITION_INDEPENDENT_CODE"] = self.options.fPIC
else:
if self.settings.compiler == 'Visual Studio':
cmake.definitions["protobuf_MSVC_STATIC_RUNTIME"] = "MT" in self.settings.compiler.runtime
cmake.configure(build_folder=self.build_subfolder)
return cmake
Expand All @@ -60,7 +59,7 @@ def build(self):
cmake.build()

def package(self):
self.copy("LICENSE", dst="licenses", src=self.build_subfolder)
self.copy("LICENSE", dst="licenses", src=self.source_subfolder)
cmake = self.configure_cmake()
cmake.install()
if self.settings.os == "Macos" and self.options.shared:
Expand Down
Binary file added logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 21b67ec

Please sign in to comment.