diff --git a/.gitignore b/.gitignore index 7d4da21b..eed0f5bf 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,7 @@ boost-build.jam project-config.jam *.pyc .vscode/settings.json + +# build2 entries. +# +.bdep/ diff --git a/build/.gitignore b/build/.gitignore new file mode 100644 index 00000000..4a730a32 --- /dev/null +++ b/build/.gitignore @@ -0,0 +1,3 @@ +config.build +root/ +bootstrap/ diff --git a/build/bootstrap.build b/build/bootstrap.build new file mode 100644 index 00000000..99076e27 --- /dev/null +++ b/build/bootstrap.build @@ -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 diff --git a/build/export.build b/build/export.build new file mode 100644 index 00000000..93198645 --- /dev/null +++ b/build/export.build @@ -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 diff --git a/build/root.build b/build/root.build new file mode 100644 index 00000000..1a33bab3 --- /dev/null +++ b/build/root.build @@ -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 diff --git a/buildfile b/buildfile new file mode 100644 index 00000000..8f77ec49 --- /dev/null +++ b/buildfile @@ -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 diff --git a/include/buildfile b/include/buildfile new file mode 100644 index 00000000..168900b0 --- /dev/null +++ b/include/buildfile @@ -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 diff --git a/manifest b/manifest new file mode 100644 index 00000000..0ab5cd55 --- /dev/null +++ b/manifest @@ -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: grafikrobot@gmail.com +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- diff --git a/test/build/.gitignore b/test/build/.gitignore new file mode 100644 index 00000000..4a730a32 --- /dev/null +++ b/test/build/.gitignore @@ -0,0 +1,3 @@ +config.build +root/ +bootstrap/ diff --git a/test/build/bootstrap.build b/test/build/bootstrap.build new file mode 100644 index 00000000..217fc45c --- /dev/null +++ b/test/build/bootstrap.build @@ -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 diff --git a/test/build/root.build b/test/build/root.build new file mode 100644 index 00000000..e8ce6d00 --- /dev/null +++ b/test/build/root.build @@ -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 diff --git a/test/buildfile b/test/buildfile new file mode 100644 index 00000000..29fced9f --- /dev/null +++ b/test/buildfile @@ -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