forked from conan-community/conan-boost
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.py
35 lines (27 loc) · 1.24 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
from conan.packager import ConanMultiPackager
import copy
import os
import platform
if __name__ == "__main__":
builder = ConanMultiPackager()
if os.getenv("HEADER_ONLY"):
builder.add({}, {"boost:header_only": True})
else:
builder.add_common_builds(shared_option_name="boost:shared", pure_c=False)
if platform.system() == "Windows":
filtered_builds = []
for settings, options, env_vars, build_requires in builder.builds:
# MinGW shared with linker errors. I don't have a clue
if settings["compiler"] == "gcc" and options["boost:shared"] is True:
continue
filtered_builds.append([settings, options, env_vars, build_requires])
builder.builds = filtered_builds
if platform.system() == "Linux":
filtered_builds = []
for settings, options, env_vars, build_requires in builder.builds:
filtered_builds.append([settings, options])
new_options = copy.copy(options)
new_options["boost:fPIC"] = True
filtered_builds.append([settings, new_options, env_vars, build_requires])
builder.builds = filtered_builds
builder.run()