-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathconanfile.py
More file actions
60 lines (48 loc) · 1.67 KB
/
conanfile.py
File metadata and controls
60 lines (48 loc) · 1.67 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
from conan import ConanFile
from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout
class AudresampleLibConan(ConanFile):
name = "audresamplelib"
version = "latest"
license = "MIT"
url = "https://github.com/audeering/audresamplelib"
description = "A C-wrapper around soxr for Sample Rate Conversion (SRC)"
topics = ("resample", "soxr")
generators = "CMakeDeps"
settings = "os", "arch", "compiler", "build_type"
options = {
"shared": [True, False],
"fPIC": [True, False],
"build_tools": [True, False],
}
default_options = {
"shared": False,
"fPIC": True,
"build_tools": False,
}
exports_sources = "src/*", "include/*", "progsrc/*", "tests/*", "CMakeLists.txt", "LICENSE"
def config_options(self):
if self.settings.os == "Windows":
self.options.rm_safe("fPIC")
def configure(self):
if self.options.shared:
self.options.rm_safe("fPIC")
self.settings.rm_safe("compiler.cppstd")
self.settings.rm_safe("compiler.libcxx")
def requirements(self):
self.requires("soxr/0.1.3", transitive_headers=True)
self.requires("drwav/0.13.7", transitive_headers=True)
def layout(self):
cmake_layout(self, src_folder=".")
def generate(self):
tc = CMakeToolchain(self)
tc.variables["BUILD_TOOLS"] = self.options.build_tools
tc.generate()
def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()
def package(self):
cmake = CMake(self)
cmake.install()
def package_info(self):
self.cpp_info.libs = ["audresample"]