forked from nanopb/nanopb
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5acd377
commit 01a5e4b
Showing
3 changed files
with
45 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from conan.packager import ConanMultiPackager | ||
|
||
if __name__ == "__main__": | ||
builder = ConanMultiPackager(build_policy="outdated") | ||
builder.add_common_builds(shared_option_name=None) | ||
builder.run() |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
cmake_minimum_required(VERSION 2.8.12) | ||
project(cmake_wrapper) | ||
|
||
include(${CMAKE_CURRENT_BINARY_DIR}/conanbuildinfo.cmake) | ||
conan_basic_setup() | ||
|
||
add_subdirectory(".." "nanopb") |
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
from conans import ConanFile, CMake, tools | ||
from os import path | ||
|
||
class NanoPbConan(ConanFile): | ||
name = "nanopb" | ||
version = "0.3.9.2" | ||
license = "zlib" | ||
url = "https://jpa.kapsi.fi/nanopb/" | ||
description = "Protocol Buffers with small code size" | ||
settings = "os", "compiler", "build_type", "arch" | ||
generators = "cmake" | ||
exports = '*' | ||
options = { | ||
"fPIC": [True, False], | ||
} | ||
default_options = { | ||
"fPIC": True, | ||
} | ||
|
||
def configure(self): | ||
if self.settings.os == "Windows" and self.settings.compiler == "Visual Studio": | ||
del self.options.fPIC | ||
|
||
def build(self): | ||
cmake = CMake(self) | ||
cmake.configure(source_folder=path.join(self.source_folder, "conan-wrapper")) | ||
cmake.build() | ||
cmake.install() | ||
|
||
def package_info(self): | ||
self.cpp_info.includedirs = ["include"] | ||
self.cpp_info.libdirs = ["lib"] |