forked from bincrafters/conan-icu
-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.py
executable file
·42 lines (37 loc) · 1.76 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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import platform
from bincrafters import (build_template_default,
build_template_installer,
build_shared)
if __name__ == "__main__":
if "ARCH" in os.environ:
arch = os.environ["ARCH"]
builder = build_template_installer.get_builder()
builder.add({"os": build_shared.get_os(),
"arch_build": arch,
"arch": arch},
{}, {}, {})
else:
builder = build_template_default.get_builder(pure_c=False)
if platform.system() == "Darwin":
# add builds with cppstd=11
filtered_builds = []
for settings, options, env_vars, build_requires in builder.builds:
settings_cppstd = settings.copy()
settings_cppstd["compiler.cppstd"] = 11
filtered_builds.append([settings_cppstd, options, env_vars, build_requires])
filtered_builds.append([settings, options, env_vars, build_requires])
builder.builds = filtered_builds
if platform.system() == "Linux":
# add builds with libstdc++11
filtered_builds = []
for settings, options, env_vars, build_requires in builder.builds:
if (settings["compiler"] == "clang") and (float(settings["compiler.version"]) >= 6):
settings_libstdcxx11 = settings.copy()
settings_libstdcxx11["compiler.libcxx"] = "libstdc++11"
filtered_builds.append([settings_libstdcxx11, options, env_vars, build_requires])
filtered_builds.append([settings, options, env_vars, build_requires])
builder.builds = filtered_builds
builder.run()