Building C++ Boost, and Boosting C++ Builds

Embed Size (px)

Text of Building C++ Boost, and Boosting C++ Builds

Building C++ BoostandBoosting C++ BuildsVladimir Prus, Joom

Boost.Build C++ c : Building C++ Boost: Boosting C++ Builds

Boost C++ Libraries, 2001

Building C++ Boost - Windows/Linux/Mac/Solaris/QNX

Req. 1:

Building C++ Boost

Req. 2:

Building C++ Boost

2001

Building C++ Boostautomake/autoconfCMakeSCons

Boost.Build

Boost.BuildV1: 2001: Proof of conceptDave Abrahams, Rene Rivera, Vladimir PrusV2: 2005: Current versionVladimir Prus, Steven Watanabe, Rene ReveraV3: 2017: Python port, IDE support, incremental rebuildshttp://boost.org/build

Boost.Buildlib hello : hello.cpp ;

$ b2gcc -o bin/gcc/libhello.so

Hello, World

Boost.Build

Boost.Buildlib hello : hello.cpp ;

$ b2 link=staticar bin/gcc/link-static/libhello.a

Hello, static World

Boost.Build

Boost.Buildlib hello : hello.cpp ;

$ b2 toolset=msvclink bin/msvc/link-shared/hello.dll

Hello, Windows World

Boost.Build

No reconfigure, or clean, just add a parameter.

Boost.Buildlib hello : hello.cpp ;

$ b2 toolset=gcc toolset=msvcgcc -o bin/gcc/libhello.solink bin/msvc/hello.dll

Hello, both Worlds

Boost.Build

Boost.Buildlib hello : hello.cpp : space ;

$ b2gcc -o bin/gcc/optimization-space/libhello.so

Requirements

Boost.Build

Boost.Buildif toolset == msvc { lib hello : hello.cpp static ;} else { lib hello : hello.cpp ;}Conditional Requirements 1

Boost.Build

Boost.Buildlib hello : hello.cpp : msvc:static;

rule customize ( properties * ) { if msvc in $(properties) { return static ;}lib hello2 : hello.cpp : @customize ;

Conditional Requirements

Boost.Build

Boost.Buildproject boost : requirements $(BOOST_ROOT) ;

lib hello : hello.cpp ;

Project Requirements

Boost.Build

Boost.Buildproject boost : requirements $(BOOST_ROOT) : usage-requirements $(BOOST_ROOT) ;

lib hello : hello.cpp ;

exe app : app.cpp /boost//hello ;

Usage Requirements

Boost.Build

Boost C++

Boost.Buildboost-lib program_options : $(SOURCES).cpp : hpux,gcc: _INCLUDE_STDC__SOURCE_199901 ;

Boost.Build

Boost.Buildproject : requirements ../build//boost_program_options ; test-suite program_options : [ run parsers_test.cpp ] [ run parsers_test.cpp : shared ] ;

Boost.Build

PCH

Boost.Buildcpp-pch pch : pch.hpp ;run test_gamma_dist.cpp pch ;

Boost.Build

Boost.Build

IDE

Boosting C++ Builds

Boosting C++ Builds 3 Android, iOS, Windows RT, Embedded ++

: CMake

add_library(foo ...)set_property( TARGET foo PROPERTY INTERFACE_INCLUDE_DIRECTORIES "/opt/foo/include")

Boosting C++ Builds

: QBS

Library { cpp.optimization: small Properties { condition: qbs.buildVariant == "debug" cpp.defines: ["QS_LOG_LINE_NUMBERS"] }}

Boosting C++ Builds

: QBS

Library { Export { cpp.includePaths: [product.sourceDirectory] }}

Boosting C++ Builds

Boost.Build 2016

Boost C++ Libraries Python http://boost.org/build

vladimir.prus@gmail.com@vladimirprus