Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@ boost-build.jam
project-config.jam
*.pyc
.vscode/settings.json

# build2 entries.
#
.bdep/
3 changes: 3 additions & 0 deletions build/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
config.build
root/
bootstrap/
12 changes: 12 additions & 0 deletions build/bootstrap.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Copyright Boris Kolpackov 2019
# Distributed under the Boost Software License, Version 1.0.
# See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt

project = libboost-predef

using version
using config
using test
using install
using dist
14 changes: 14 additions & 0 deletions build/export.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright Boris Kolpackov 2019
# Distributed under the Boost Software License, Version 1.0.
# See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt

# Export stub: load the buildfile from include/ and export the library
# target.
#
$out_root/
{
include include/
}

export $out_root/include/$import.target
18 changes: 18 additions & 0 deletions build/root.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright Boris Kolpackov 2019
# Distributed under the Boost Software License, Version 1.0.
# See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt

using c

h{*}: extension = h

cxx.std = latest

using cxx

hxx{*}: extension = hpp

# The test target for cross-testing (running tests under Wine, etc).
#
test.target = $cxx.target
10 changes: 10 additions & 0 deletions buildfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Copyright Boris Kolpackov 2019
# Distributed under the Boost Software License, Version 1.0.
# See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt

./: include/ test/ manifest

# Don't install tests.
#
test/: install = false
21 changes: 21 additions & 0 deletions include/buildfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright Boris Kolpackov 2019
# Distributed under the Boost Software License, Version 1.0.
# See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt

# For a library with source code this will normally be in src/. For a header-
# only library, include/ feels like a natural alternative.
#
lib{boost_predef}: {h hxx}{**}

# Build options.
#
cxx.poptions =+ "-I$src_base"

# Export options.
#
lib{boost_predef}: cxx.export.poptions = "-I$src_base"

# Install headers recreating subdirectories.
#
{h hxx}{*}: install.subdirs = true
17 changes: 17 additions & 0 deletions manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
: 1
name: libboost-predef
project: libboost
version: 1.9.0
summary: Boost Predef C++ library
license: Boost Software License v1.0
url: https://github.com/boostorg/predef/
email: [email protected]
description: \
This library defines a set of compiler, architecture, operating system,
library, and other version numbers from the information it can gather of C,
C++, Objective C, and Objective C++ predefined macros or those defined in
generally available headers.
\
builds: all
depends: * build2 >= 0.9.0-
depends: * bpkg >= 0.9.0-
3 changes: 3 additions & 0 deletions test/build/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
config.build
root/
bootstrap/
10 changes: 10 additions & 0 deletions test/build/bootstrap.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Copyright Boris Kolpackov 2019
# Distributed under the Boost Software License, Version 1.0.
# See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt

project = # Unnamed test subproject.

using config
using test
using dist
24 changes: 24 additions & 0 deletions test/build/root.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Copyright Boris Kolpackov 2019
# Distributed under the Boost Software License, Version 1.0.
# See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt

using c

h{*}: extension = h
c{*}: extension = c

cxx.std = latest

using cxx

hxx{*}: extension = hpp
cxx{*}: extension = cpp

# Every exe{} in this subproject is by default a test.
#
exe{*}: test = true

# The test target for cross-testing (running tests under Wine, etc).
#
test.target = $cxx.target
44 changes: 44 additions & 0 deletions test/buildfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Copyright Boris Kolpackov 2019
# Distributed under the Boost Software License, Version 1.0.
# See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt

import libs = libboost-predef%lib{boost_predef}

# Run tests.
#
for t: info_as_c info_as_cpp check_value make tested_at version workaround
{
# Note that some of them are C and some C++. Rather than using separate
# loops, let's use the wildcard pattern machinery (without the wildcard) to
# pick the right prerequisite type.
#
./: exe{$t}: {c cxx}{+$t} $libs
}

# Test-specific tweaks.
#
obj{check_value}: cxx.poptions += -DCHECK_VALUE=true

exe{info_as_c info_as_cpp}: h{predef_info}

# Compile tests.
#
# Note: the expected-to-fail tested_at_outdated is currently not handled; we
# could probably do something ad hoc with a testscript but perhaps there
# should be a better way.
#
./: obje{workaround_strict_config}: cxx{workaround_strict_config} $libs

# Windows-specific tests.
#
./: obje{platform_windows}: include = ($cxx.target.class == 'windows')

obje{platform_windows}: cxx{platform_windows} $libs

# Mac OS-specific tests.
#
./: obje{macos_endian macos_vs_bsd}: include = ($c.target.class == 'macos')

obje{macos_endian}: c{macos_endian} $libs
obje{macos_vs_bsd}: c{macos_vs_bsd} $libs