https://github.com/bfgroup/b2-conan
A Conan utility to help, and adapt, Conan building to run B2 as needed.
https://github.com/bfgroup/b2-conan
Last synced: 2 months ago
JSON representation
A Conan utility to help, and adapt, Conan building to run B2 as needed.
- Host: GitHub
- URL: https://github.com/bfgroup/b2-conan
- Owner: bfgroup
- License: bsl-1.0
- Created: 2022-01-05T04:33:05.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-11-27T03:14:51.000Z (over 3 years ago)
- Last Synced: 2024-11-17T15:18:48.725Z (over 1 year ago)
- Language: Python
- Size: 27.3 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.adoc
- Funding: .github/FUNDING.yml
- License: LICENSE.txt
Awesome Lists containing this project
README
== Overview
A Conan utility to help, and adapt, Conan building to run B2 as needed.
== How To Use
Using this utility is simple using the
link:https://docs.conan.io/en/latest/extending/python_requires.html[`python_requires`]
Conan facility.
[source,python]
----
from conans import ConanFile, tools
required_conan_version = ">=1.44.0"
class Package(ConanFile):
name = "my_package"
tool_requires = ("b2/[>=4.7.0]@")
python_requires = ("b2-conan/1.0.0@bfgroup/b2-conan")
source_subfolder = "source_subfolder"
def build(self):
b2 = self.python_requires["b2-conan"].module.B2(self)
sources = os.path.join(self.source_folder, self.source_subfolder)
with tools.chdir(sources):
b2.build()
----
That, when used in your own package that is based on
link:https://www.bfgroup.xyz/b2/[B2] will run B2 with the options needed to
match the Conan build variation.
The `B2.build` takes a couple of arguments to further control what gets built
and how:
[source,python]
----
def build(self, args=None, build_dir=None, target=None)
----
* `args` (Optional, Defaulted to `None`) Extra arguments to invoke B2 with.
* `build_dir` (Optional, Defaulted to `None`) The intermediate output build
directory.
* `target` (Optional, Defaulted to `None`) A set of one or more targets to build.
These are added to the command line invocation directly. And must use the B2
target syntax.