forked from DEGoodmanWilson/conan-gmp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.py
36 lines (28 loc) · 1.44 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
import platform
from conan.packager import ConanMultiPackager
import os
import cpuid
import copy
def handle_microarchs(opt_name, microarchs, filtered_builds, settings, options, env_vars, build_requires):
# print(microarchs)
microarchs = list(set(microarchs))
# print(microarchs)
for ma in microarchs:
opts_copy = copy.deepcopy(options)
opts_copy[opt_name] = ma
filtered_builds.append([settings, opts_copy, env_vars, build_requires])
if __name__ == "__main__":
builder = ConanMultiPackager(username="bitprim", channel="stable",
remotes="https://api.bintray.com/conan/bitprim/bitprim")
builder.add_common_builds(shared_option_name="gmp:shared", pure_c=True)
builder.password = os.getenv("CONAN_PASSWORD")
filtered_builds = []
for settings, options, env_vars, build_requires in builder.builds:
if settings["build_type"] == "Release" \
and settings["arch"] == "x86_64" \
and not ("gmp:shared" in options and options["gmp:shared"]):
# marchs = ["x86_64", ''.join(cpuid.cpu_microarchitecture()), "haswell", "skylake", "ivybridge", "sandybridge"]
marchs = ["x86_64", ''.join(cpuid.cpu_microarchitecture()), "haswell", "skylake"]
handle_microarchs("gmp:microarchitecture", marchs, filtered_builds, settings, options, env_vars, build_requires)
builder.builds = filtered_builds
builder.run()