This repository has been archived by the owner on Jun 24, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from bincrafters/testing/3.5.2
#381 Minor refinement
- Loading branch information
Showing
3 changed files
with
19 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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" | ||
|
@@ -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': | ||
|
@@ -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) | ||
|
||
|
@@ -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 | ||
|
@@ -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: | ||
|