forked from jens-f/conan-Ne10
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconanfile.py
More file actions
69 lines (59 loc) · 2.46 KB
/
conanfile.py
File metadata and controls
69 lines (59 loc) · 2.46 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# -*- coding: utf-8 -*-
import os
from conans import ConanFile, CMake, tools
class PahocConan(ConanFile):
name = "Ne10"
version = "1.2.2-2020.02.11" # version number rarely changes, so add date
# source_subfolder = "sources"
scm = {
"type": "git",
# "subfolder": source_subfolder,
"url": "https://github.com/projectNe10/Ne10.git",
# latest commit, 2018.11.15
"revision": "1f059a764d0e1bc2481c0055c0e71538470baa83"
}
homepage = "https://github.com/projectNe10/Ne10"
description = "An open optimized software library project for the ARM® Architecture."
url = "https://github.com/jens-totemic/conan-Ne10"
settings = "os", "compiler", "build_type", "arch"
options = {"shared": [True, False],
"fPIC": [True, False]}
default_options = {"shared": False,
"fPIC": True}
generators = "cmake"
exports = "LICENSE"
exports_sources = ["01-build-c-only.patch", "02-increase-cpuinfo-buffer-size.patch"]
def config_options(self):
if self.settings.os == "Windows":
del self.options.fPIC
def configure(self):
del self.settings.compiler.libcxx
def _configure_cmake(self):
cmake = CMake(self)
armOnly = False
if self.settings.os == "Linux":
if self.settings.arch == "armv7hf":
armOnly = True
cmake.definitions["NE10_LINUX_TARGET_ARCH"] = "armv7"
cmake.definitions["CMAKE_SYSTEM_PROCESSOR"] = "arm"
elif self.settings.arch == "armv8":
armOnly = True
cmake.definitions["NE10_LINUX_TARGET_ARCH"] = "aarch64"
cmake.definitions["CMAKE_SYSTEM_PROCESSOR"] = "arm"
cmake.definitions["GNULINUX_PLATFORM"] = True
cmake.definitions["NE10_BUILD_ARM_ONLY"] = armOnly
cmake.definitions["NE10_BUILD_SHARED"] = self.options.shared
cmake.definitions["NE10_BUILD_STATIC"] = not self.options.shared
cmake.configure()
return cmake
def build(self):
tools.patch(patch_file="01-build-c-only.patch")
tools.patch(patch_file="02-increase-cpuinfo-buffer-size.patch")
cmake = self._configure_cmake()
cmake.build()
def package(self):
cmake = self._configure_cmake()
cmake.install()
def package_info(self):
self.cpp_info.libs = tools.collect_libs(self)
self.cpp_info.includedirs.append(os.path.join("include", "ne10"))