-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.py
executable file
·55 lines (45 loc) · 1.69 KB
/
build.py
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
#!/usr/bin/env python3
from conan.packager import ConanMultiPackager
from conans.tools import os_info
import copy
import os
class ArduinoPackager(ConanMultiPackager):
def addArduino(self, options={}):
if os.getenv("CONAN_DOCKER_IMAGE") or os.getenv("CONAN_USE_DOCKER"):
# Arduino builds fail if conan was lunched with docker image specification
return None
self.add(settings={
"os": "Arduino",
"os.board": "XYZrobot1280",
"compiler": "gcc",
"compiler.version": "5.4",
"compiler.libcxx": "libstdc++11",
"arch": "avr"
}, options=options, env_vars={
"CC": "gcc"
}, build_requires={
"*": ["arduino-toolchain/1.8.8@conan/testing"]
})
if __name__ == "__main__":
builder = ArduinoPackager(build_policy="outdated",
upload="https://api.bintray.com/conan/anton-matosov/general",
login_username="anton-matosov",
username="conan",
channel="testing",
stable_branch_pattern="release/*",
)
if os.getenv("DRQP_NATIVE_BUILD") == "1":
builder.add()
if os.getenv("DRQP_ARDUINO_BUILD") == "1":
builder.addArduino()
if os_info.is_linux:
filtered_builds = []
for settings, options, env_vars, build_requires in builder.builds:
filtered_builds.append(
[settings, options, env_vars, build_requires])
new_options = copy.copy(options)
new_options["arduino-sdk:host_os"] = "linux32"
filtered_builds.append(
[settings, new_options, env_vars, build_requires])
builder.builds = filtered_builds
builder.run()