Last active
September 19, 2018 13:04
-
-
Save solvingj/b1edd3e975da51a4e76c7932d44f1ccb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from conans import ConanFile, tools | |
from conans import python_requires | |
base = python_requires("boost_base/1.67.0@bincrafters/testing") | |
class BoostContextConan(base.BoostBaseConan): | |
name = "boost_context" | |
lib_short_names = ["context"] | |
options = {"shared": [True, False]} | |
default_options = "shared=False" | |
source_only_deps = [ | |
"thread" | |
] | |
requires = ( | |
"boost_assert/1.67.0@bincrafters/testing", | |
"boost_config/1.67.0@bincrafters/testing", | |
"boost_package_tools/1.67.0@bincrafters/testing", | |
"boost_pool/1.67.0@bincrafters/testing", | |
"boost_predef/1.67.0@bincrafters/testing", | |
"boost_smart_ptr/1.67.0@bincrafters/testing" | |
) | |
def build_additional(self): | |
import os | |
with open(os.path.join(self.build_folder, "context", "lib", "jamroot.jam"), "a") as f: | |
f.write(""" | |
import feature ; | |
feature.feature segmented-stacks : on : optional propagated composite ; | |
feature.compose <segmented-stacks>on : <define>BOOST_USE_SEGMENTED_STACKS ; | |
""") | |
def get_b2_options(self): | |
return { | |
"binary-format" : self.b2_binary_format if self.b2_binary_format else "", | |
"abi" : self.b2_abi if self.b2_abi else "", | |
} | |
@property | |
def b2_binary_format(self): | |
if self.settings.os == "iOS" or self.settings.os == "Macos": | |
return "mach-o" | |
elif self.settings.os == "Android" or self.settings.os == "Linux": | |
return "elf" | |
elif self.settings.os == "Windows": | |
return "pe" | |
else: | |
return None | |
@property | |
def b2_abi(self): | |
if str(self.settings.arch).startswith('x86'): | |
if self.settings.os == "Windows": | |
return "ms" | |
else: | |
return "sysv" | |
elif str(self.settings.arch).startswith('ppc'): | |
return "sysv" | |
elif str(self.settings.arch).startswith('arm'): | |
return "aapcs" | |
else: | |
return None | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment