Compare commits

...

24 Commits

Author SHA1 Message Date
13de873d87 Work around Boost removing modular include dirs for release. 2019-03-08 18:42:27 -06:00
2e65c250f5 Update copyright date. 2019-01-21 22:33:23 -06:00
a2608f26a3 Rework ARM detection to favor versioned predefs.
This reworks the order in which the compiler predefs are checked to use
the ones that provide version info. Also add the arch predefs for older
compilers that don't define the predefs with version info for arm4,
arm5, arm6, and arm7.

Continuation of #94
2019-01-21 22:13:42 -06:00
7e31244f01 Fix bad include of sub-BSD os headers from main BSD header.
Fixes #85
2019-01-14 00:21:46 -06:00
6fea8a4b90 Fix NetBSD def name. 2019-01-13 11:56:08 -06:00
fee815d6d7 Missed release note for iOS platform type fix. 2019-01-13 09:00:06 -06:00
2e35ba95c8 Fixes use of deprecated TARGET_IPHONE_SIMULATOR.
The TARGET_IPHONE_SIMULATOR predef was deprecated in favor of
TARGET_OS_SIMULATOR. We now use both predefs to detect device vs.
simulator.

Fixes #83
2019-01-13 08:53:22 -06:00
cb4f8140f1 Add history note for B2 standalone project. 2019-01-11 22:05:53 -06:00
f2de8d8211 Another tweak for standalone and symetric build. 2019-01-11 21:36:07 -06:00
a340a52605 Add PLAT_ANDROID and deprecate OS_ANDROID.
Fixes #41 #81
2019-01-10 13:27:41 -06:00
48d9231a1b Convert build files to rootless parity with hash-predef. 2019-01-09 16:27:04 -06:00
eb682657a2 Add detection of ARM from __aarch64__ predef.
Fixes #94
2019-01-07 16:28:30 -06:00
c53294180d Refresh from Hash. 2019-01-07 08:33:58 -06:00
9ead140e5b Minor tweaks to cmake support to make hash-boost conversion easier. 2019-01-07 08:18:59 -06:00
d33798214d Cleanups of cmake build use support. 2019-01-03 21:57:47 -06:00
f862009841 [CMake] Generate cmake target that other libraries can use (#86)
Generates cmake target that other libraries can use to express
their dependency on this library and retrieve any configuration
information such as the include directory.
2019-01-02 07:26:48 -06:00
d58fcca2d5 os/linux: add more linux detection defines. (#91)
Some releases of g++, on some platforms, whilst running under some
standards, may not define neither linux, nor __linux. Add detections
for __linux__ and __gnu_linux__ for robustness.
2018-11-26 08:15:55 -06:00
aa94d69718 Add history note for Cygwin OS predef. 2018-11-06 09:35:15 -06:00
62a50d3892 Add version information to os/cygwin detection (#88) 2018-11-06 08:56:11 -06:00
32d4581c16 Deprecation message for detail endian headers. 2018-09-03 15:42:43 -05:00
92881c4c7a Bump version for next release. 2018-09-02 14:30:00 -05:00
07df9dd360 Always define BOOST_COMP_NVCC instead of BOOST_COMP_NVCC_EMULATED (#84)
Currently BOOST_COMP_NVCC is never set but always BOOST_COMP_NVCC_EMULATED
because the NVCC preprocessor emulates the host compiler being used
(gcc/clang/msvc/...) which are detected earlier.

The nvcc compilation process is somewhat special as can be read here:
https://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html#cuda-compilation-trajectory
The nvcc compiler precompiles the input two times. Once for the device code
being compiled by the cicc device compiler and once for the host code
compiled by the real host compiler. NVCC uses gcc/clang/msvc/...
depending on the host compiler being set on the command line.

Predef (as a preprocessor only lib) detects the one doing the preprocessing
as compiler and expects it to be the one doing the real compilation.
This is not true for NVCC which is only doing the preprocessing and which
is using another compiler for parts of its work. So for NVCC it should be
allowed to set BOOST_COMP_NVCC additionally to the already detected host
compiler because both is true: It is gcc/clang/... compiling the code, but it
is also NVCC doing th preprocessing and adding some other quirks you may
want to detect.

This behavior is similar to what boost config is doing in `select_compiler_config.hpp`.
There the NVCC detection is not handled as a real compiler (part of the
#if-#elif) but as additional option before the real compiler.
2018-08-30 14:41:44 -05:00
d8f410b4d0 Live patch project during CI testing. 2018-08-26 10:32:47 -05:00
759400b413 Rebase from hash-predef source. 2018-08-25 23:36:20 -05:00
26 changed files with 474 additions and 258 deletions

6
.gitignore vendored
View File

@ -1,3 +1,5 @@
/bin
/boost-build.jam
bin
boost-build.jam
project-config.jam
*.pyc
.vscode/settings.json

View File

@ -2,7 +2,7 @@
# subject to 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)
#
# Copyright Rene Rivera 2015-2016.
# Copyright Rene Rivera 2015-2018.
# Setting up notifications like this is optional as the default behavior
# of Travis is to notify the commiter of problems. But setting a specific
@ -13,13 +13,6 @@ notifications:
recipients:
- grafikrobot@gmail.com
# For now the CI scripts only support the two main branches available
# on the boost super-project.
branches:
only:
- master
- develop
# We specify a generic language instead of C++ as Travis sets up
# additional environment vars that point to its default toolset
# instead of the one we install. The extra env doesn't interfere,
@ -28,7 +21,7 @@ branches:
language: generic
# Speficy the default as Linux here, to avoid duplication in the matrix
# below. We use Trausty as that's the latest we can use. And it's better
# below. We use Trusty as that's the latest we can use. And it's better
# supported by the whole range of C++ toolsets we like to test on.
dist: trusty
os: linux
@ -55,6 +48,23 @@ matrix:
exclude:
- env: TRAVIS_EMPTY_JOB_WORKAROUND=true
include:
# Check CMake project use support.
- env: TEST_CMAKE
# Skip all the unneeded steps from the normal unit test jobs
install: true
before_script: true
before_cache: true
before_cache: true
after_success: true
after_failure: true
after_script: true
# Build CMake simple test project that uses Predef.
script:
- mkdir __build__ && cd __build__
- cmake ../test/test_cmake
- cmake --build .
- env: TOOLSET=clang-3.4
- env: TOOLSET=clang-3.5
- env: TOOLSET=clang-3.6
@ -68,14 +78,18 @@ matrix:
- env: TOOLSET=gcc-4.9
- env: TOOLSET=gcc-5
- env: TOOLSET=gcc-6
- env: TOOLSET=gcc-7 CXXFLAGS=-std=c++03
- env: TOOLSET=gcc-7 CXXFLAGS=-std=c++11
- env: TOOLSET=gcc-7 CXXFLAGS=-std=c++14
- env: TOOLSET=gcc-7 CXXFLAGS=-std=c++1z
- env: TOOLSET=gcc-7 CXXFLAGS=-std=gnu++03
- env: TOOLSET=gcc-7 CXXFLAGS=-std=gnu++11
- env: TOOLSET=gcc-7 CXXFLAGS=-std=gnu++14
- env: TOOLSET=gcc-7 CXXFLAGS=-std=gnu++1z
- env: TOOLSET=gcc-7
- env: TOOLSET=gcc-8
- env: TOOLSET=gcc-8 CXXFLAGS=-std=c++03
- env: TOOLSET=gcc-8 CXXFLAGS=-std=c++11
- env: TOOLSET=gcc-8 CXXFLAGS=-std=c++14
- env: TOOLSET=gcc-8 CXXFLAGS=-std=c++17
- env: TOOLSET=gcc-8 CXXFLAGS=-std=c++2a
- env: TOOLSET=gcc-8 CXXFLAGS=-std=gnu++03
- env: TOOLSET=gcc-8 CXXFLAGS=-std=gnu++11
- env: TOOLSET=gcc-8 CXXFLAGS=-std=gnu++14
- env: TOOLSET=gcc-8 CXXFLAGS=-std=gnu++17
- env: TOOLSET=gcc-8 CXXFLAGS=-std=gnu++2a
- env: TOOLSET=xcode-6.1
os: osx
- env: TOOLSET=xcode-6.4
@ -84,18 +98,27 @@ matrix:
- env: TOOLSET=xcode-7.3
os: osx
osx_image: xcode7.3
- env: TOOLSET=xcode-8.3 CXXFLAGS=-std=c++03
- env: TOOLSET=xcode-8.3
os: osx
osx_image: xcode8.3
- env: TOOLSET=xcode-8.3 CXXFLAGS=-std=c++11
- env: TOOLSET=xcode-9.4 CXXFLAGS=-std=c++03
os: osx
osx_image: xcode8.3
- env: TOOLSET=xcode-8.3 CXXFLAGS=-std=c++14
osx_image: xcode9.4
- env: TOOLSET=xcode-9.4 CXXFLAGS=-std=c++11
os: osx
osx_image: xcode8.3
- env: TOOLSET=xcode-8.3 CXXFLAGS=-std=c++1z
osx_image: xcode9.4
- env: TOOLSET=xcode-9.4 CXXFLAGS=-std=c++14
os: osx
osx_image: xcode8.3
osx_image: xcode9.4
- env: TOOLSET=xcode-9.4 CXXFLAGS=-std=c++17
os: osx
osx_image: xcode9.4
- env: TOOLSET=xcode-9.4 CXXFLAGS=-std=c++2a
os: osx
osx_image: xcode9.4
- env: TOOLSET=xcode-10.0
os: osx
osx_image: xcode10.0
install: python "${TRAVIS_BUILD_DIR}/tools/ci/library_test.py" install
before_script: python "${TRAVIS_BUILD_DIR}/tools/ci/library_test.py" before_script
@ -104,6 +127,3 @@ before_cache: python "${TRAVIS_BUILD_DIR}/tools/ci/library_test.py" before_cache
after_success: python "${TRAVIS_BUILD_DIR}/tools/ci/library_test.py" after_success
after_failure: python "${TRAVIS_BUILD_DIR}/tools/ci/library_test.py" after_failure
after_script: python "${TRAVIS_BUILD_DIR}/tools/ci/library_test.py" after_script
cache:
directories:
- $HOME/boostorg/boost

38
CMakeLists.txt Normal file
View File

@ -0,0 +1,38 @@
# Copyright Mike Dev 2018
# Copyright Rene Rivera 2018
# 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
# NOTE:
# CMake support for Boost.Predef is currently experimental at best and the
# interface is likely to change in the future
#
# This file provides minimal cmake support (no unit-tests,
# no installation) for integration into a "host" cmake project
# via the "add_subdirectory( <path-to-boost-predef> )" command.
#
# Other cmake targets can then use the public target name
# "Boost::predef" in order to express their dependency
# on this library. I.e:
#
# target_link_libraries( <my-exe/lib> PUBLIC Boost::predef )
# Only need the basic minimum of project, add_library, and
# target_include_directories commands.
cmake_minimum_required( VERSION 3.0 )
# Don't set VERSION, as that's a pita to keep up to date with the version
# header. And don't set LANGUAGES as we are multi-language and header
# only, so it's irrelevant.
project( BoostPredef )
# Simple INTERFACE, and header only, library target.
add_library( boost_predef INTERFACE )
# The only usage requirement is include dir for consumers.
target_include_directories( boost_predef INTERFACE include )
# Add an alias to be compatible with consumers that may have used the
# FindBoost script.
add_library( Boost::predef ALIAS boost_predef )

View File

@ -1,6 +1,43 @@
# Copyright Rene Rivera 2014
# Copyright Rene Rivera 2014-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)
#|
This B2 project provides support for using the Predef library externally as
a standalone project or by embedding in your B2 project tree. To use
externally you would need a `use-project` declaration and to use the
project as a dependency where needed:
----
use-project /hash-predef : /path/to/hash-predef/root ;
exe my_thing : main.cpp : <dependency>/hash-predef ;
----
To use in your project tree you would only need to place the Predef tree
in a subdirectory and reference the project location as a dependency where
needed.
----
exe my_thin : main.cpp : <dependency>libs/hash-predef ;
----
|#
import project ;
path-constant BOOST_PREDEF_ROOT : . ;
path-constant BOOST_PREDEF_INCLUDE : include ;
constant PREDEF_DIST : boost ;
project /boost/predef
: usage-requirements
<include>$(BOOST_PREDEF_INCLUDE) ;
if [ project.is-jamroot-module $(__name__) ]
{
local attributes = [ project.attributes $(__name__) ] ;
$(attributes).set "build-dir" : bin ;
}
alias libs ;

View File

@ -7,6 +7,22 @@ http://www.boost.org/LICENSE_1_0.txt)
[section History]
[heading 1.10]
* Fix bad include of sub-BSD os headers from main BSD header.
* Fix use of deprecated `TARGET_IPHONE_SIMULATOR` instead of newer
`TARGET_OS_SIMULATOR`.
* Add `BOOST_PLAT_ANDROID` to resolve conflict between Linux and Android
OS predefs. The `BOOST_OS_ANDROID` predef is now deprecated and will be
removed in a future release.
* Add support for consuming Predef as a CMake project.
* Add support for consuming Predef as a standalone B2 project.
[heading 1.9]
* Fixes for `BOOST_COMP_NVCC*` predefs. (from Benjamin Worpitz)
* Add specific version information for Cygwin OS predef. (from James E. King III)
[heading 1.8]
* Add support for __ARM_ARCH macro. (from Tim Blechmann)

View File

@ -1,8 +1,8 @@
[article Boost.Predef
[quickbook 1.7]
[version 1.7]
[version 1.10]
[authors [Rivera, Rene]]
[copyright 2005-2016 Rene Rivera]
[copyright 2005-2019 Rene Rivera]
[copyright 2015 Charly Chevalier]
[copyright 2015 Joel Falcou]
[purpose Identification and specification of predefined macros.]
@ -235,7 +235,7 @@ commonly emulated by other compilers by defining the same base macros. To
account for this detection headers are allowed to define `*_EMULATED` predefs
when this situation is detected. The emulated predefs will be set to the
version number of the detection instead of the regular predef macro for that
detection. For example MSVC will set `BOOST_COMP_MSVC_EMULATED` but not set `BOOST_COM_MSVC`, and it will also set `BOOST_COMP_MSVC_AVAILABLE`.
detection. For example MSVC will set `BOOST_COMP_MSVC_EMULATED` but not set `BOOST_COMP_MSVC`, and it will also set `BOOST_COMP_MSVC_AVAILABLE`.
[heading Using the `BOOST_VERSION_NUMBER` macro]
@ -401,7 +401,7 @@ We also need to provide the `*_AVAILABLE` versions of the predef.
And for convenience we also want to provide a `*_NAME` macro:
``
#define BOOST_catagory_tag_NAME "Name"
#define BOOST_category_tag_NAME "Name"
``
The testing of the predef macros is automated to generate checks for all
@ -507,7 +507,7 @@ uses a simple 3-digit version macro (M,N,P). It can be decomposed
and defined as:
``
#define BOOST_CCOMP_EDG BOOST_PREDEF_MAKE_N_N_N(__EDG_VERSION__)
#define BOOST_COMP_EDG BOOST_PREDEF_MAKE_N_N_N(__EDG_VERSION__)
``
The decomposition macros are split into three types: decimal

View File

@ -1,5 +1,5 @@
/*
Copyright Rene Rivera 2008-2015
Copyright Rene Rivera 2008-2019
Copyright Franz Detro 2014
Copyright (c) Microsoft Corporation 2014
Distributed under the Boost Software License, Version 1.0.
@ -21,32 +21,68 @@ http://www.boost.org/LICENSE_1_0.txt)
[table
[[__predef_symbol__] [__predef_version__]]
[[`__arm__`] [__predef_detection__]]
[[`__arm64`] [__predef_detection__]]
[[`__thumb__`] [__predef_detection__]]
[[`__ARM_ARCH`] [__predef_detection__]]
[[`__TARGET_ARCH_ARM`] [__predef_detection__]]
[[`__TARGET_ARCH_THUMB`] [__predef_detection__]]
[[`_M_ARM`] [__predef_detection__]]
[[`__arm__`] [__predef_detection__]]
[[`__arm64`] [__predef_detection__]]
[[`__thumb__`] [__predef_detection__]]
[[`_M_ARM64`] [__predef_detection__]]
[[`__aarch64__`] [__predef_detection__]]
[[`__AARCH64EL__`] [__predef_detection__]]
[[`__ARM_ARCH_7__`] [__predef_detection__]]
[[`__ARM_ARCH_7A__`] [__predef_detection__]]
[[`__ARM_ARCH_7R__`] [__predef_detection__]]
[[`__ARM_ARCH_7M__`] [__predef_detection__]]
[[`__ARM_ARCH_6K__`] [__predef_detection__]]
[[`__ARM_ARCH_6Z__`] [__predef_detection__]]
[[`__ARM_ARCH_6KZ__`] [__predef_detection__]]
[[`__ARM_ARCH_6T2__`] [__predef_detection__]]
[[`__ARM_ARCH_5TE__`] [__predef_detection__]]
[[`__ARM_ARCH_5TEJ__`] [__predef_detection__]]
[[`__ARM_ARCH_4T__`] [__predef_detection__]]
[[`__ARM_ARCH_4__`] [__predef_detection__]]
[[`__arm64`] [8.0.0]]
[[`__ARM_ARCH`] [V.0.0]]
[[`__TARGET_ARCH_ARM`] [V.0.0]]
[[`__TARGET_ARCH_THUMB`] [V.0.0]]
[[`__ARM_ARCH`] [V.0.0]]
[[`_M_ARM`] [V.0.0]]
[[`__arm64`] [8.0.0]]
[[`_M_ARM64`] [8.0.0]]
[[`__aarch64__`] [8.0.0]]
[[`__AARCH64EL__`] [8.0.0]]
[[`__ARM_ARCH_7__`] [7.0.0]]
[[`__ARM_ARCH_7A__`] [7.0.0]]
[[`__ARM_ARCH_7R__`] [7.0.0]]
[[`__ARM_ARCH_7M__`] [7.0.0]]
[[`__ARM_ARCH_6K__`] [6.0.0]]
[[`__ARM_ARCH_6Z__`] [6.0.0]]
[[`__ARM_ARCH_6KZ__`] [6.0.0]]
[[`__ARM_ARCH_6T2__`] [6.0.0]]
[[`__ARM_ARCH_5TE__`] [5.0.0]]
[[`__ARM_ARCH_5TEJ__`] [5.0.0]]
[[`__ARM_ARCH_4T__`] [4.0.0]]
[[`__ARM_ARCH_4__`] [4.0.0]]
]
*/
#define BOOST_ARCH_ARM BOOST_VERSION_NUMBER_NOT_AVAILABLE
#if defined(__arm__) || defined(__arm64) || defined(__thumb__) || \
defined(__TARGET_ARCH_ARM) || defined(__TARGET_ARCH_THUMB) || \
defined(__ARM_ARCH) || \
defined(_M_ARM) || defined(_M_ARM64)
#if \
defined(__ARM_ARCH) || defined(__TARGET_ARCH_ARM) || \
defined(__TARGET_ARCH_THUMB) || defined(_M_ARM) || \
defined(__arm__) || defined(__arm64) || defined(__thumb__) || \
defined(_M_ARM64) || defined(__aarch64__) || defined(__AARCH64EL__) || \
defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) || \
defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) || \
defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6Z__) || \
defined(__ARM_ARCH_6KZ__) || defined(__ARM_ARCH_6T2__) || \
defined(__ARM_ARCH_5TE__) || defined(__ARM_ARCH_5TEJ__) || \
defined(__ARM_ARCH_4T__) || defined(__ARM_ARCH_4__)
# undef BOOST_ARCH_ARM
# if !defined(BOOST_ARCH_ARM) && defined(__arm64)
# define BOOST_ARCH_ARM BOOST_VERSION_NUMBER(8,0,0)
# if !defined(BOOST_ARCH_ARM) && defined(__ARM_ARCH)
# define BOOST_ARCH_ARM BOOST_VERSION_NUMBER(__ARM_ARCH,0,0)
# endif
# if !defined(BOOST_ARCH_ARM) && defined(__TARGET_ARCH_ARM)
# define BOOST_ARCH_ARM BOOST_VERSION_NUMBER(__TARGET_ARCH_ARM,0,0)
@ -54,15 +90,32 @@ http://www.boost.org/LICENSE_1_0.txt)
# if !defined(BOOST_ARCH_ARM) && defined(__TARGET_ARCH_THUMB)
# define BOOST_ARCH_ARM BOOST_VERSION_NUMBER(__TARGET_ARCH_THUMB,0,0)
# endif
# if !defined(BOOST_ARCH_ARM) && defined(__ARM_ARCH)
# define BOOST_ARCH_ARM BOOST_VERSION_NUMBER(__ARM_ARCH,0,0)
# endif
# if !defined(BOOST_ARCH_ARM) && defined(_M_ARM64)
# define BOOST_ARCH_ARM BOOST_VERSION_NUMBER(8,0,0)
# endif
# if !defined(BOOST_ARCH_ARM) && defined(_M_ARM)
# define BOOST_ARCH_ARM BOOST_VERSION_NUMBER(_M_ARM,0,0)
# endif
# if !defined(BOOST_ARCH_ARM) && ( \
defined(__arm64) || defined(_M_ARM64) || defined(__aarch64__) || \
defined(__AARCH64EL__) )
# define BOOST_ARCH_ARM BOOST_VERSION_NUMBER(8,0,0)
# endif
# if !defined(BOOST_ARCH_ARM) && ( \
defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) || \
defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) )
# define BOOST_ARCH_ARM BOOST_VERSION_NUMBER(7,0,0)
# endif
# if !defined(BOOST_ARCH_ARM) && ( \
defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6Z__) || \
defined(__ARM_ARCH_6KZ__) || defined(__ARM_ARCH_6T2__) )
# define BOOST_ARCH_ARM BOOST_VERSION_NUMBER(6,0,0)
# endif
# if !defined(BOOST_ARCH_ARM) && ( \
defined(__ARM_ARCH_5TE__) || defined(__ARM_ARCH_5TEJ__) )
# define BOOST_ARCH_ARM BOOST_VERSION_NUMBER(5,0,0)
# endif
# if !defined(BOOST_ARCH_ARM) && ( \
defined(__ARM_ARCH_4T__) || defined(__ARM_ARCH_4__) )
# define BOOST_ARCH_ARM BOOST_VERSION_NUMBER(4,0,0)
# endif
# if !defined(BOOST_ARCH_ARM)
# define BOOST_ARCH_ARM BOOST_VERSION_NUMBER_AVAILABLE
# endif

View File

@ -38,7 +38,7 @@ Version number available as major, minor, and patch.
# define BOOST_COMP_DEC_DETECTION BOOST_PREDEF_MAKE_10_VVRR0PP00(__DECC_VER)
# endif
# if !defined(BOOST_COMP_DEC_DETECTION)
# define BOOST_COM_DEC_DETECTION BOOST_VERSION_NUMBER_AVAILABLE
# define BOOST_COMP_DEC_DETECTION BOOST_VERSION_NUMBER_AVAILABLE
# endif
#endif

View File

@ -37,12 +37,30 @@ Version number available as major, minor, and patch beginning with version 7.5.
#endif
#ifdef BOOST_COMP_NVCC_DETECTION
# if defined(BOOST_PREDEF_DETAIL_COMP_DETECTED)
# define BOOST_COMP_NVCC_EMULATED BOOST_COMP_NVCC_DETECTION
# else
# undef BOOST_COMP_NVCC
# define BOOST_COMP_NVCC BOOST_COMP_NVCC_DETECTION
# endif
/*
Always define BOOST_COMP_NVCC instead of BOOST_COMP_NVCC_EMULATED
The nvcc compilation process is somewhat special as can be read here:
https://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html#cuda-compilation-trajectory
The nvcc compiler precompiles the input two times. Once for the device code
being compiled by the cicc device compiler and once for the host code
compiled by the real host compiler. NVCC uses gcc/clang/msvc/...
depending on the host compiler being set on the command line.
Predef (as a preprocessor only lib) detects the one doing the preprocessing
as compiler and expects it to be the one doing the real compilation.
This is not true for NVCC which is only doing the preprocessing and which
is using another compiler for parts of its work. So for NVCC it should be
allowed to set BOOST_COMP_NVCC additionally to the already detected host
compiler because both is true: It is gcc/clang/... compiling the code, but it
is also NVCC doing the preprocessing and adding some other quirks you may
want to detect.
This behavior is similar to what boost config is doing in `select_compiler_config.hpp`.
There the NVCC detection is not handled as a real compiler (part of the
#if-#elif) but as additional option before the real compiler.
*/
# undef BOOST_COMP_NVCC
# define BOOST_COMP_NVCC BOOST_COMP_NVCC_DETECTION
# define BOOST_COMP_NVCC_AVAILABLE
# include <boost/predef/detail/comp_detected.h>
#endif
@ -53,8 +71,3 @@ Version number available as major, minor, and patch beginning with version 7.5.
#include <boost/predef/detail/test.h>
BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_NVCC,BOOST_COMP_NVCC_NAME)
#ifdef BOOST_COMP_NVCC_EMULATED
#include <boost/predef/detail/test.h>
BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_NVCC_EMULATED,BOOST_COMP_NVCC_NAME)
#endif

View File

@ -1,5 +1,5 @@
/*
Copyright Rene Rivera 2013
Copyright Rene Rivera 2013-2018
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)
@ -8,6 +8,8 @@ http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_PREDEF_DETAIL_ENDIAN_COMPAT_H
#define BOOST_PREDEF_DETAIL_ENDIAN_COMPAT_H
#pragma message("The use of BOOST_*_ENDIAN and BOOST_BYTE_ORDER is deprecated. Please include <boost/predef/other/endian.h> and use BOOST_ENDIAN_*_BYTE instead")
#include <boost/predef/other/endian.h>
#if BOOST_ENDIAN_BIG_BYTE

View File

@ -13,7 +13,6 @@ http://www.boost.org/LICENSE_1_0.txt)
#include <boost/predef/os/aix.h>
#include <boost/predef/os/amigaos.h>
#include <boost/predef/os/android.h>
#include <boost/predef/os/beos.h>
#include <boost/predef/os/bsd.h>
#include <boost/predef/os/cygwin.h>
@ -30,4 +29,6 @@ http://www.boost.org/LICENSE_1_0.txt)
#include <boost/predef/os/vms.h>
#include <boost/predef/os/windows.h>
#include <boost/predef/os/android.h>
#endif

View File

@ -14,6 +14,9 @@ http://www.boost.org/LICENSE_1_0.txt)
/*`
[heading `BOOST_OS_ANDROID`]
NOTE: `BOOST_OS_ANDROID` is deprecated, and will be removed in a following release.
Please use `BOOST_PLAT_ANDROID` instead.
[@http://en.wikipedia.org/wiki/Android_%28operating_system%29 Android] operating system.
[table

View File

@ -89,7 +89,7 @@ of BSD. If the above variants is detected the corresponding macro is also set.]
#define BOOST_OS_BSD_NAME "BSD"
#else
#endif
#include <boost/predef/os/bsd/bsdi.h>
#include <boost/predef/os/bsd/dragonfly.h>
@ -97,7 +97,5 @@ of BSD. If the above variants is detected the corresponding macro is also set.]
#include <boost/predef/os/bsd/open.h>
#include <boost/predef/os/bsd/net.h>
#endif
#include <boost/predef/detail/test.h>
BOOST_PREDEF_DECLARE_TEST(BOOST_OS_BSD,BOOST_OS_BSD_NAME)

View File

@ -76,7 +76,7 @@ http://www.boost.org/LICENSE_1_0.txt)
# include <boost/predef/detail/os_detected.h>
#endif
#define BOOST_OS_BSD_NET_NAME "DragonFly BSD"
#define BOOST_OS_BSD_NET_NAME "NetBSD"
#endif

View File

@ -20,6 +20,8 @@ http://www.boost.org/LICENSE_1_0.txt)
[[__predef_symbol__] [__predef_version__]]
[[`__CYGWIN__`] [__predef_detection__]]
[[`CYGWIN_VERSION_API_MAJOR`, `CYGWIN_VERSION_API_MINOR`] [V.R.0]]
]
*/
@ -28,8 +30,11 @@ http://www.boost.org/LICENSE_1_0.txt)
#if !defined(BOOST_PREDEF_DETAIL_OS_DETECTED) && ( \
defined(__CYGWIN__) \
)
# include <cygwin/version.h>
# undef BOOST_OS_CYGWIN
# define BOOST_OS_CYGWIN BOOST_VERSION_NUMBER_AVAILABLE
# define BOOST_OS_CYGWIN \
BOOST_VERSION_NUMBER(CYGWIN_VERSION_API_MAJOR,\
CYGWIN_VERSION_API_MINOR, 0)
#endif
#if BOOST_OS_CYGWIN

View File

@ -21,13 +21,16 @@ http://www.boost.org/LICENSE_1_0.txt)
[[`linux`] [__predef_detection__]]
[[`__linux`] [__predef_detection__]]
[[`__linux__`] [__predef_detection__]]
[[`__gnu_linux__`] [__predef_detection__]]
]
*/
#define BOOST_OS_LINUX BOOST_VERSION_NUMBER_NOT_AVAILABLE
#if !defined(BOOST_PREDEF_DETAIL_OS_DETECTED) && ( \
defined(linux) || defined(__linux) \
defined(linux) || defined(__linux) || \
defined(__linux__) || defined(__gnu_linux__) \
)
# undef BOOST_OS_LINUX
# define BOOST_OS_LINUX BOOST_VERSION_NUMBER_AVAILABLE

View File

@ -11,6 +11,7 @@ http://www.boost.org/LICENSE_1_0.txt)
#define BOOST_PREDEF_PLATFORM_H
#endif
#include <boost/predef/platform/android.h>
#include <boost/predef/platform/cloudabi.h>
#include <boost/predef/platform/mingw.h>
#include <boost/predef/platform/mingw32.h>

View File

@ -0,0 +1,43 @@
/*
Copyright Rene Rivera 2015-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)
*/
#ifndef BOOST_PREDEF_PLAT_ANDROID_H
#define BOOST_PREDEF_PLAT_ANDROID_H
#include <boost/predef/version_number.h>
#include <boost/predef/make.h>
/*`
[heading `BOOST_PLAT_ANDROID`]
[@http://en.wikipedia.org/wiki/Android_%28operating_system%29 Android] platform.
[table
[[__predef_symbol__] [__predef_version__]]
[[`__ANDROID__`] [__predef_detection__]]
]
*/
#define BOOST_PLAT_ANDROID BOOST_VERSION_NUMBER_NOT_AVAILABLE
#if defined(__ANDROID__)
# undef BOOST_PLAT_ANDROID
# define BOOST_PLAT_ANDROID BOOST_VERSION_NUMBER_AVAILABLE
#endif
#if BOOST_PLAT_ANDROID
# define BOOST_PLAT_ANDROID_AVAILABLE
# include <boost/predef/detail/platform_detected.h>
#endif
#define BOOST_PLAT_ANDROID_NAME "Android"
#endif
#include <boost/predef/detail/test.h>
BOOST_PREDEF_DECLARE_TEST(BOOST_PLAT_ANDROID,BOOST_PLAT_ANDROID_NAME)

View File

@ -20,6 +20,7 @@ http://www.boost.org/LICENSE_1_0.txt)
[[__predef_symbol__] [__predef_version__]]
[[`TARGET_IPHONE_SIMULATOR`] [__predef_detection__]]
[[`TARGET_OS_SIMULATOR`] [__predef_detection__]]
]
*/
@ -29,7 +30,10 @@ http://www.boost.org/LICENSE_1_0.txt)
// https://opensource.apple.com/source/CarbonHeaders/CarbonHeaders-18.1/TargetConditionals.h
#if BOOST_OS_IOS
# include <TargetConditionals.h>
# if TARGET_IPHONE_SIMULATOR == 1
# if defined(TARGET_OS_SIMULATOR) && (TARGET_OS_SIMULATOR == 1)
# undef BOOST_PLAT_IOS_SIMULATOR
# define BOOST_PLAT_IOS_SIMULATOR BOOST_VERSION_NUMBER_AVAILABLE
# elif defined(TARGET_IPHONE_SIMULATOR) && (TARGET_IPHONE_SIMULATOR == 1)
# undef BOOST_PLAT_IOS_SIMULATOR
# define BOOST_PLAT_IOS_SIMULATOR BOOST_VERSION_NUMBER_AVAILABLE
# else

View File

@ -10,6 +10,6 @@ http://www.boost.org/LICENSE_1_0.txt)
#include <boost/predef/version_number.h>
#define BOOST_PREDEF_VERSION BOOST_VERSION_NUMBER(1,8,0)
#define BOOST_PREDEF_VERSION BOOST_VERSION_NUMBER(1,10,0)
#endif

View File

@ -1,49 +1,26 @@
#!/usr/bin/env b2 -a --verbose-test
# Copyright Rene Rivera 2011-2016
# Copyright Rene Rivera 2011-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 ../check/predef : require check : predef-require predef-check ;
import ../tools/check/predef : require check : predef-require predef-check ;
import path ;
local predef-include-root ;
local predef-dependency ;
local modular-predef-h = [ glob $(BOOST_PREDEF_ROOT)/include/boost/predef.h ] ;
local BOOST_RELEASE_LAYOUT ;
if ! $(modular-predef-h)
# This deals with the unfortunate aspect of a Boost monolithic release
# not having the modular include dirs. This is a kludge that just removes
# the direct depdndency to the header if it can't find it.
local PREDEF_H = $(BOOST_PREDEF_INCLUDE)/boost/predef.h ;
if ! [ path.exists $(PREDEF_H) ]
{
BOOST_RELEASE_LAYOUT = yes ;
PREDEF_H = ;
}
# When using modular layout, header files are not present in $root/boost
# unlink links are created, therefore instead of direct dependency on
# a header, we need to use dependency on metatarget.
if $(BOOST_RELEASE_LAYOUT)
{
predef-dependency = $(predef-include-root)/boost/predef.h ;
}
else if $(BOOST_PREDEF_ROOT)
{
predef-include-root = $(BOOST_PREDEF_ROOT)/include ;
predef-dependency = $(predef-include-root)/boost/predef.h ;
}
else if $(BOOST_MODULARLAYOUT)
{
predef-include-root = $(BOOST_ROOT) ;
predef-dependency = /boost//predef-headers ;
}
else
{
predef-dependency = $(predef-include-root)/boost/predef.h ;
}
project predef-test
project
: requirements
<include>$(predef-include-root)
<include>$(BOOST_PREDEF_INCLUDE)
# Add explicit dependency since we don't have header scanner for
# .m and .mm files.
<dependency>$(predef-dependency)
<dependency>$(PREDEF_H)
;
using testing ;

View File

@ -0,0 +1,29 @@
# Copyright Mike Dev 2018
# Copyright Rene Rivera 2018
# 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
# NOTE:
# This does NOT run the unit tests for Boost.Predef.
# It only tests, if the CMakeLists.txt file in predef's
# root directory works as expected (i.e. it provides the
# target Boost::predef which in turn provides the
# correct include directory )
# We have very simple cmake requirements we we still require the new style
# declarative targets.
cmake_minimum_required( VERSION 3.0 )
project( PredefCMakeSelfTest )
# Process cmake file at root of library and use
# ${CMAKE_CURRENT_BINARY_DIR}/libs/predef as workspace
add_subdirectory( ../.. ${CMAKE_CURRENT_BINARY_DIR}/libs/predef )
# The executable just includes a predef header to verify that it's used.
add_executable( predef_cmake_test_prj main.cpp )
# The executable needs to "use" the Predef "library" to get the usage
# requirements added to the executable build.
target_link_libraries( predef_cmake_test_prj Boost::predef )

19
test/test_cmake/main.cpp Normal file
View File

@ -0,0 +1,19 @@
/*
Copyright Mike Dev 2018
Copyright 2018 Rene Rivera
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
*/
/*
Dummy executable, just to make sure that we can find the Boost Predef header
files.
*/
#include <boost/predef.h>
int main()
{
return 0;
}

View File

@ -102,8 +102,8 @@ local rule change_term_to_def ( term )
if $(parts[3])
{
local version_number = [ regex.split $(parts[3]) "[.]" ] ;
if ! $(version_number[3]) { version_number += "0" ; }
if ! $(version_number[2]) { version_number += "0" ; }
if ! $(version_number[3]) { version_number += "0" ; }
parts = $(parts[1-2]) BOOST_VERSION_NUMBER($(version_number:J=",")) ;
}
return <define>CHECK=\"$(parts:J=" ")\" ;

View File

@ -254,6 +254,26 @@ toolset_info = {
'toolset' : 'clang',
'version' : ''
},
'xcode-9.2' : {
'command' : 'clang++',
'toolset' : 'clang',
'version' : ''
},
'xcode-9.3' : {
'command' : 'clang++',
'toolset' : 'clang',
'version' : ''
},
'xcode-9.4' : {
'command' : 'clang++',
'toolset' : 'clang',
'version' : ''
},
'xcode-10.0' : {
'command' : 'clang++',
'toolset' : 'clang',
'version' : ''
},
}
class SystemCallError(Exception):
@ -435,24 +455,24 @@ class utils:
return boost_version
@staticmethod
def git_clone(sub_repo, branch, commit = None, cwd = None, no_submodules = False):
def git_clone(owner, repo, branch, commit = None, repo_dir = None, submodules = False, url_format = "https://github.com/%(owner)s/%(repo)s.git"):
'''
This clone mimicks the way Travis-CI clones a project's repo. So far
Travis-CI is the most limiting in the sense of only fetching partial
history of the repo.
'''
if not cwd:
cwd = cwd = os.getcwd()
root_dir = os.path.join(cwd,'boostorg',sub_repo)
if not os.path.exists(os.path.join(root_dir,'.git')):
if not repo_dir:
repo_dir = os.path.join(os.getcwd(), owner+','+repo)
utils.makedirs(os.path.dirname(repo_dir))
if not os.path.exists(os.path.join(repo_dir,'.git')):
utils.check_call("git","clone",
"--depth=1",
"--branch=%s"%(branch),
"https://github.com/boostorg/%s.git"%(sub_repo),
root_dir)
os.chdir(root_dir)
url_format%{'owner':owner,'repo':repo},
repo_dir)
os.chdir(repo_dir)
else:
os.chdir(root_dir)
os.chdir(repo_dir)
utils.check_call("git","pull",
# "--depth=1", # Can't do depth as we get merge errors.
"--quiet","--no-recurse-submodules")
@ -463,12 +483,12 @@ class utils:
utils.check_call('dir',os.path.join('.git','modules'))
else:
utils.check_call('ls','-la',os.path.join('.git','modules'))
if not no_submodules:
if submodules:
utils.check_call("git","submodule","--quiet","update",
"--quiet","--init","--recursive",
)
utils.check_call("git","submodule","--quiet","foreach","git","fetch")
return root_dir
return repo_dir
class parallel_call(threading.Thread):
'''
@ -496,7 +516,7 @@ def set_arg(args, k, v = None):
class script_common(object):
'''
Main script to run Boost C++ Libraries continuous integration.
Main script to run continuous integration.
'''
def __init__(self, ci_klass, **kargs):
@ -521,7 +541,7 @@ class script_common(object):
set_arg(kargs,'branch',None)
set_arg(kargs,'commit',None)
set_arg(kargs,'repo',None)
set_arg(kargs,'root_dir',None)
set_arg(kargs,'repo_dir',None)
set_arg(kargs,'actions',None)
set_arg(kargs,'pull_request', None)
@ -533,9 +553,9 @@ class script_common(object):
self.actions = kargs.get('actions',None)
if not self.actions or self.actions == []:
self.actions = [ 'info' ]
if not self.root_dir:
self.root_dir = os.getcwd()
self.build_dir = os.path.join(os.path.dirname(self.root_dir), "build")
if not self.repo_dir:
self.repo_dir = os.getcwd()
self.build_dir = os.path.join(os.path.dirname(self.repo_dir), "build")
# API keys.
self.bintray_key = os.getenv('BINTRAY_KEY')
@ -562,8 +582,8 @@ class script_common(object):
ci_script = getattr(self, action_m, None)
if ci_command or ci_script:
utils.log( "### %s.."%(action) )
if os.path.exists(self.root_dir):
os.chdir(self.root_dir)
if os.path.exists(self.repo_dir):
os.chdir(self.repo_dir)
if ci_command:
ci_command()
elif ci_script:
@ -614,9 +634,9 @@ class ci_cli(object):
The common way to use this variant is to invoke something like:
mkdir boost-ci
cd boost-ci
python path-to/ci_boost_<script>.py --branch=develop [--repo=mylib] ...
mkdir ci
cd ci
python path-to/library_test.py --branch=develop [--repo=mylib] ...
Status: In working order.
'''
@ -630,31 +650,23 @@ class ci_cli(object):
if os.path.isdir(doxygen_path):
os.environ["PATH"] = doxygen_path+':'+os.environ['PATH']
self.script = script
self.work_dir = os.getcwd()
self.repo_dir = os.getcwd()
self.exit_result = 0
def init(self, opt, kargs):
kargs['actions'] = [
'clone',
# 'clone',
'install',
'before_build',
'build',
'before_cache',
'finish'
]
opt.add_option( '--repo',
help="Boost repo short name we are testing with, and hence the repo we clone.")
set_arg(kargs,'repo','boost')
return kargs
def finish(self, result):
self.exit_result = result
def command_clone(self):
self.script.root_dir = os.path.join(self.work_dir,'boostorg',self.script.repo)
self.script.build_dir = os.path.join(os.path.dirname(self.script.root_dir), "build")
utils.git_clone(self.script.repo, self.script.branch, self.script.commit, self.work_dir)
def command_finish(self):
exit(self.exit_result)
@ -665,10 +677,9 @@ class ci_travis(object):
def __init__(self,script):
self.script = script
self.work_dir = os.getenv("HOME")
def init(self, opt, kargs):
set_arg(kargs,'root_dir', os.getenv("TRAVIS_BUILD_DIR"))
set_arg(kargs,'repo_dir', os.getenv("TRAVIS_BUILD_DIR"))
set_arg(kargs,'branch', os.getenv("TRAVIS_BRANCH"))
set_arg(kargs,'commit', os.getenv("TRAVIS_COMMIT"))
set_arg(kargs,'repo', os.getenv("TRAVIS_REPO_SLUG").split("/")[1])
@ -686,7 +697,7 @@ class ci_travis(object):
'''
info = toolset_info[toolset]
if sys.platform.startswith('linux'):
os.chdir(self.work_dir)
os.chdir(self.script.build_dir)
if 'ppa' in info:
for ppa in info['ppa']:
utils.check_call(
@ -748,10 +759,9 @@ class ci_circleci(object):
def __init__(self,script):
self.script = script
self.work_dir = os.getenv("HOME")
def init(self, opt, kargs):
set_arg(kargs,'root_dir', os.path.join(os.getenv("HOME"),os.getenv("CIRCLE_PROJECT_REPONAME")))
set_arg(kargs,'repo_dir', os.path.join(os.getenv("HOME"),os.getenv("CIRCLE_PROJECT_REPONAME")))
set_arg(kargs,'branch', os.getenv("CIRCLE_BRANCH"))
set_arg(kargs,'commit', os.getenv("CIRCLE_SHA1"))
set_arg(kargs,'repo', os.getenv("CIRCLE_PROJECT_REPONAME").split("/")[1])
@ -768,7 +778,7 @@ class ci_circleci(object):
utils.check_call("pip","install","--user","PyYAML")
def command_checkout_post(self):
os.chdir(self.script.root_dir)
os.chdir(self.script.repo_dir)
utils.check_call("git","submodule","update","--quiet","--init","--recursive")
def command_dependencies_pre(self):
@ -777,7 +787,7 @@ class ci_circleci(object):
import yaml
utils.check_call('sudo','-E','apt-get','-yqq','update')
utils.check_call('sudo','apt-get','-yqq','purge','texlive*')
with open(os.path.join(self.script.root_dir,'.travis.yml')) as yml:
with open(os.path.join(self.script.repo_dir,'.travis.yml')) as yml:
travis_yml = yaml.load(yml)
utils.check_call('sudo','apt-get','-yqq',
'--no-install-suggests','--no-install-recommends','--force-yes','install',
@ -817,10 +827,9 @@ class ci_appveyor(object):
def __init__(self,script):
self.script = script
self.work_dir = os.path.dirname(os.getenv("APPVEYOR_BUILD_FOLDER"))
def init(self, opt, kargs):
set_arg(kargs,'root_dir',os.getenv("APPVEYOR_BUILD_FOLDER"))
set_arg(kargs,'repo_dir',os.getenv("APPVEYOR_BUILD_FOLDER"))
set_arg(kargs,'branch',os.getenv("APPVEYOR_REPO_BRANCH"))
set_arg(kargs,'commit',os.getenv("APPVEYOR_REPO_COMMIT"))
set_arg(kargs,'repo',os.getenv("APPVEYOR_REPO_NAME").split("/")[1])
@ -839,7 +848,7 @@ class ci_appveyor(object):
self.script.command_install()
def command_before_build(self):
os.chdir(self.script.root_dir)
os.chdir(self.script.repo_dir)
utils.check_call("git","submodule","update","--quiet","--init","--recursive")
self.script.command_before_build()

View File

@ -36,39 +36,12 @@ class script(script_common):
set_arg(kargs, 'variant', os.getenv("VARIANT","debug"))
set_arg(kargs, 'cxxflags', os.getenv("CXXFLAGS",None))
return kargs
def start(self):
script_common.start(self)
# Some setup we need to redo for each invocation.
self.boost_root = os.path.join(self.ci.work_dir,'boostorg','boost')
@property
def repo_path(self):
if not hasattr(self,'_repo_path'):
# Find the path for the submodule of the repo we are testing.
if self.repo != 'boost':
self._repo_path = None
with open(os.path.join(self.boost_root,'.gitmodules'),"rU") as f:
path = None
url = None
for line in f:
line = line.strip()
if line.startswith("[submodule"):
path = None
url = None
else:
name = line.split("=")[0].strip()
value = line.split("=")[1].strip()
if name == "path":
path = value
elif name == "url":
url = value
if name and url and url.endswith("/%s.git"%(self.repo)):
self._repo_path = path
if not self._repo_path:
self._repo_path = "libs/%s"%(self.repo)
return self._repo_path
self.b2_dir = os.path.join(self.build_dir, 'b2')
def command_install(self):
script_common.command_install(self)
# Fetch & install toolset..
@ -79,38 +52,16 @@ class script(script_common):
def command_before_build(self):
script_common.command_before_build(self)
# Clone boost super-project.
if self.repo != 'boost':
utils.git_clone('boost',self.branch,cwd=self.ci.work_dir,no_submodules=True)
utils.check_call("git","submodule","update","--quiet","--init","tools/build")
utils.check_call("git","submodule","update","--quiet","--init","tools/boostdep")
# The global jamfiles require config as they trigger build config checks.
utils.check_call("git","submodule","update","--quiet","--init","libs/config")
# Fetch dependencies.
utils.git_clone('boostorg','build','develop',repo_dir=self.b2_dir)
# Find the path for the submodule of the repo we are testing.
if self.repo != 'boost':
self.repo_dir = os.path.join(self.boost_root,self.repo_path)
if self.repo != 'boost':
# Copy in the existing library tree checkout.
shutil.rmtree(self.repo_path)
shutil.copytree(self.root_dir, self.repo_path)
# Fetch the dependencies for the library we are testing.
if self.repo != 'boost':
os.chdir(self.boost_root)
utils.check_call(
sys.executable,
'tools/boostdep/depinst/depinst.py',
self.repo)
# Create config file for toolset.
# Create config file for b2 toolset.
if not isinstance(self.ci, ci_cli):
cxxflags = None
if self.cxxflags:
cxxflags = self.cxxflags.split()
cxxflags = " <cxxflags>".join(cxxflags)
utils.make_file(os.path.join(self.boost_root, 'project-config.jam'),
utils.make_file(os.path.join(self.repo_dir, 'project-config.jam'),
"""
using %(toolset)s : %(version)s : %(command)s : %(cxxflags)s ;
using python : %(pyversion)s : "%(python)s" ;
@ -122,77 +73,69 @@ using python : %(pyversion)s : "%(python)s" ;
'pyversion':"%s.%s"%(sys.version_info[0],sys.version_info[1]),
'python':sys.executable.replace("\\","\\\\")
})
# "Convert" boostorg-predef into standalone b2 project.
if os.path.exists(os.path.join(self.repo_dir,'build.jam')) and not os.path.exists(os.path.join(self.repo_dir,'project-root.jam')):
os.rename(os.path.join(self.repo_dir,'build.jam'), os.path.join(self.repo_dir,'project-root.jam'))
def command_build(self):
script_common.command_build(self)
# Set up tools.
utils.makedirs(os.path.join(self.build_dir,'dist','bin'))
if not isinstance(self.ci, ci_cli) and toolset_info[self.toolset]['command']:
os.environ['PATH'] = os.pathsep.join([
os.path.dirname(toolset_info[self.toolset]['command']),
os.path.join(self.build_dir,'dist','bin'),
os.environ['PATH']])
else:
os.environ['PATH'] = os.pathsep.join([
os.path.join(self.build_dir,'dist','bin'),
os.environ['PATH']])
os.environ['BOOST_BUILD_PATH'] = self.build_dir
# Bootstrap Boost Build engine.
os.chdir(os.path.join(self.boost_root,"tools","build"))
os.chdir(self.b2_dir)
if sys.platform == 'win32':
utils.check_call(".\\bootstrap.bat")
shutil.copy2("b2.exe", os.path.join(self.build_dir,"dist","bin","b2.exe"))
else:
utils.check_call("./bootstrap.sh")
shutil.copy2("b2", os.path.join(self.build_dir,"dist","bin","b2"))
utils.check_call("git","clean","-dfqx")
os.environ['PATH'] = os.pathsep.join([self.b2_dir, os.environ['PATH']])
os.environ['BOOST_BUILD_PATH'] = self.b2_dir
# Run the limited tests.
if self.repo != 'boost':
print("--- Testing %s ---"%(self.repo_path))
os.chdir(os.path.join(self.boost_root,'status'))
to_test = self.repo_path.split("/")
del to_test[0]
toolset_to_test = ""
if self.toolset:
if not isinstance(self.ci, ci_cli):
toolset_to_test = toolset_info[self.toolset]['toolset']
else:
toolset_to_test = self.toolset
self.b2(
'-d1',
'-p0',
'--include-tests=%s'%("/".join(to_test)),
'preserve-test-targets=off',
'--dump-tests',
'--build-dir=%s'%(self.build_dir),
'--out-xml=%s'%(os.path.join(self.build_dir,'regression.xml')),
'' if not toolset_to_test else 'toolset=%s'%(toolset_to_test),
'' if not self.address_model else 'address-model=%s'%(self.address_model),
'variant=%s'%(self.variant),
'--test-type=%s'%(self.target),
'--verbose-test'
)
# Generate a readable test report.
import build_log
log_main = build_log.Main([
'--output=console',
os.path.join(self.build_dir,'regression.xml')])
# And exit with an error if the report contains failures.
# This lets the CI notice the error and report a failed build.
# And hence trigger the failure machinery, like sending emails.
if log_main.failed:
self.ci.finish(-1)
print("--- Testing %s ---"%(self.repo_dir))
os.chdir(os.path.join(self.repo_dir,'test'))
toolset_to_test = ""
if self.toolset:
if not isinstance(self.ci, ci_cli):
toolset_to_test = toolset_info[self.toolset]['toolset']
else:
toolset_to_test = self.toolset
self.b2(
'-d1',
'-p0',
'preserve-test-targets=off',
'--dump-tests',
'--verbose-test',
'--build-dir=%s'%(self.build_dir),
'--out-xml=%s'%(os.path.join(self.build_dir,'regression.xml')),
'' if not toolset_to_test else 'toolset=%s'%(toolset_to_test),
'' if not self.address_model else 'address-model=%s'%(self.address_model),
'variant=%s'%(self.variant),
self.target
)
# Generate a readable test report.
import build_log
log_main = build_log.Main([
'--output=console',
os.path.join(self.build_dir,'regression.xml')])
# And exit with an error if the report contains failures.
# This lets the CI notice the error and report a failed build.
# And hence trigger the failure machinery, like sending emails.
if log_main.failed:
self.ci.finish(-1)
def command_before_cache(self):
script_common.command_before_cache(self)
os.chdir(self.boost_root)
os.chdir(self.b2_dir)
utils.check_call("git","clean","-dfqx")
utils.check_call("git","submodule","--quiet","foreach","git","clean","-dfqx")
utils.check_call("git","status","-bs")
utils.check_call("git","submodule","foreach","git","status","-bs")
# utils.check_call("git","submodule","--quiet","foreach","git","clean","-dfqx")
# utils.check_call("git","submodule","foreach","git","status","-bs")
main(script)