Welcome to mirror list, hosted at ThFree Co, Russian Federation.

conanfile.py - github.com/nanopb/nanopb.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 7ed2d30ec4aa9e3d7ead3b0911c534df9f8cfadd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
from conans import ConanFile, CMake, tools
from os import path

class NanoPbConan(ConanFile):
    name = "nanopb"
    version = "0.4.9-dev"
    license = "zlib"
    url = "https://jpa.kapsi.fi/nanopb/"
    description = "Protocol Buffers with small code size"
    settings = "os_build", "compiler", "build_type", "arch"
    generators = "cmake"
    exports = '*'
    options = {
        "fPIC": [True, False],
    }
    default_options = {
        "fPIC": True,
    }

    def configure(self):
        if self.settings.os_build == "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"]
        self.cpp_info.libs = ["protobuf-nanopb"]