-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.py
51 lines (41 loc) · 2.02 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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from bincrafters import build_template_default
import platform
import copy
import os
if __name__ == "__main__":
builder = build_template_default.get_builder(pure_c=True)
items = []
for item in builder.items:
# skip mingw cross-builds
if not (platform.system() == "Windows" and item.settings["compiler"] == "gcc" and
item.settings["arch"] == "x86"):
new_build_requires = copy.copy(item.build_requires)
if platform.system() == "Windows" and item.settings["compiler"] == "gcc":
# add msys2 and mingw as a build requirement for mingw builds
new_build_requires["*"] = new_build_requires.get("*", []) + \
["mingw_installer/1.0@conan/stable",
"msys2_installer/latest@bincrafters/stable"]
items.append([item.settings, item.options, item.env_vars,
new_build_requires, item.reference])
# add macos builds with openssl too
if item.settings["compiler"] == "apple-clang" and item.settings["build_type"] == "Release":
new_options = copy.copy(item.options)
new_options["libcurl:darwin_ssl"] = False
items.append([item.settings, new_options, item.env_vars,
new_build_requires, item.reference])
builder.items = items
if os.getenv("_CONAN_TARGET_OS", None):
# Add non-shared builds with specific target OS
items = []
for item in builder.items:
if item.options["libcurl:shared"] == False:
new_settings = copy.copy(item.settings)
new_settings["os"] = os.getenv("_CONAN_TARGET_OS")
new_options = copy.copy(item.options)
new_options["libcurl:with_openssl"] = False
items.append([new_settings, new_options, item.env_vars,
item.build_requires, item.reference])
builder.items = items
builder.run()