Skip to content

Commit 41e4c60

Browse files
committed
Merge branch 'develop'
2 parents 6d8ddd2 + 84dfbff commit 41e4c60

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+1263
-979
lines changed

.appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Copyright 2017 - 2019 James E. King III
33
# Copyright 2019 - 2020 Alexander Grund
44
# Distributed under the Boost Software License, Version 1.0.
5-
# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt)
5+
# (See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt)
66

77
version: 1.0.{build}-{branch}
88

.azure-pipelines.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Copyright 2019 Mateusz Loskot <mateusz at loskot dot net>
33
# Copyright 2020 Alexander Grund
44
# Distributed under the Boost Software License, Version 1.0.
5-
# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt)
5+
# (See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt)
66

77
#
88
# Generic Azure Pipelines build script for boostorg repositories

.github/workflows/ci_tests.yml

Lines changed: 26 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Copyright 2019 - 2020 Alexander Grund
2+
# Distributed under the Boost Software License, Version 1.0.
3+
# (See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt)
4+
15
name: CI Tests
26

37
on:
@@ -20,55 +24,49 @@ jobs:
2024
generator: Visual Studio 16 2019
2125
- os: ubuntu-16.04
2226
buildType: Debug
23-
- os: windows-latest
24-
generator: Unix Makefiles
2527
runs-on: ${{matrix.os}}
2628
env:
2729
DEP_DIR: ${{github.workspace}}/dependencies
2830
BOOST_VERSION: 1.56.0
2931
steps:
3032
- uses: actions/checkout@v2
3133
- uses: actions/cache@v1
34+
id: cache-boost
3235
with:
3336
path: ${{env.DEP_DIR}}
3437
key: ${{matrix.os}}-${{matrix.generator}}-${{env.BOOST_VERSION}}
3538
# Install newer CMake to be able to find Boost
3639
- name: Install CMake
3740
if: runner.os == 'Linux' && matrix.standalone == 'Boost'
3841
run: wget -qO- https://cmake.org/files/v3.14/cmake-3.14.0-Linux-x86_64.tar.gz | sudo tar --strip-components=1 -xzC /usr/local
39-
# Install Boost, no wget on Windows -.-
40-
- name: Download Boost
41-
shell: cmake -P {0}
42+
- name: Set BOOST_ROOT
4243
if: matrix.standalone == 'Boost'
43-
id: downloadBoost
44-
run: |
45-
string(REPLACE "." "_" filename boost_$ENV{BOOST_VERSION})
46-
set(BOOST_ROOT $ENV{DEP_DIR}/${filename})
47-
message("::set-env name=BOOST_ROOT::${BOOST_ROOT}")
48-
if(EXISTS ${BOOST_ROOT}/include)
49-
message("::set-output name=update::0")
50-
else()
51-
message("::set-output name=update::1")
52-
set(boost_url https://sourceforge.net/projects/boost/files/boost/$ENV{BOOST_VERSION}/${filename}.7z/download)
53-
set(DEP_BUILD_DIR $ENV{DEP_DIR}/build)
54-
file(MAKE_DIRECTORY ${DEP_BUILD_DIR})
55-
file(DOWNLOAD "${boost_url}" ${DEP_BUILD_DIR}/boost.7z SHOW_PROGRESS)
56-
endif()
44+
shell: bash
45+
run: echo "::set-env name=BOOST_ROOT::${DEP_DIR//\\/\/}/boost_${BOOST_VERSION//./_}"
46+
# Install Boost
47+
- uses: actions/checkout@v2
48+
if: matrix.standalone == 'Boost' && steps.cache-boost.outputs.cache-hit != 'true'
49+
with:
50+
repository: boostorg/boost
51+
ref: boost-${{env.BOOST_VERSION}}
52+
path: __buildBoost
53+
fetch-depth: 1
5754
- name: Build Boost
5855
shell: bash
59-
if: matrix.standalone == 'Boost' && steps.downloadBoost.outputs.update == 1
60-
working-directory: ${{env.DEP_DIR}}/build
56+
if: matrix.standalone == 'Boost' && steps.cache-boost.outputs.cache-hit != 'true'
6157
run: |
62-
7z x boost.7z > /dev/null
63-
cd $(basename "$BOOST_ROOT")
64-
[[ "${{matrix.generator}}" =~ "Unix" ]] && toolset=gcc || toolset=mingw
65-
./bootstrap.sh --with-toolset="$toolset" --with-libraries=system,filesystem,chrono threading=multi || (cat bootstrap.log && false)
58+
cd __buildBoost
59+
git submodule update --init --jobs 3 tools/boostdep libs/filesystem tools/inspect libs/wave # Last 2 are required for pre-1.64
60+
(cd tools/boostdep && git fetch && git checkout boost-1.73.0 && git checkout boost-1.63.0 -- depinst/exceptions.txt)
61+
python tools/boostdep/depinst/depinst.py --include tools --exclude test --git_args '--jobs 3' filesystem
62+
[[ "${{matrix.os}}" =~ "windows" ]] && toolset=mingw || toolset=gcc
63+
./bootstrap.sh --with-toolset="$toolset" --with-libraries=system,filesystem threading=multi || (cat bootstrap.log && false)
6664
sed -i 's/mingw/gcc/' project-config.jam
6765
[[ "${{matrix.generator}}" =~ "Visual Studio" ]] && toolset=msvc-14.0 || toolset=gcc
66+
./b2 headers
6867
./b2 link=static toolset=$toolset address-model=64 -j$(nproc) --prefix="$BOOST_ROOT" install
69-
cd "$DEP_DIR"
70-
# Workaround for "Device or resource busy" error
71-
if ! rm -r build; then sleep 30s; rm -r build || true; fi
68+
cd ..
69+
rm -r __buildBoost || true
7270
- name: Create standalone
7371
if: matrix.standalone == 'Standalone'
7472
shell: bash

.github/workflows/release.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Copyright 2019 - 2020 Alexander Grund
2+
# Distributed under the Boost Software License, Version 1.0.
3+
# (See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt)
4+
15
on:
26
push:
37
tags:

.github/workflows/update_standalone.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Copyright 2019 - 2020 Alexander Grund
2+
# Distributed under the Boost Software License, Version 1.0.
3+
# (See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt)
4+
15
on:
26
push:
37
branches: [develop]
@@ -19,15 +23,24 @@ jobs:
1923
git config --global user.name "$GITHUB_ACTOR"
2024
git fetch
2125
- name: Create standalone version
26+
id: standalone
2227
run: |
2328
bash tools/create_standalone.sh /tmp/nowide_standalone
2429
git checkout "$STANDALONE_BRANCH_NAME" -- || git checkout -b "$STANDALONE_BRANCH_NAME"
2530
git rm -r *
2631
mv /tmp/nowide_standalone/* .
27-
git add .
32+
# Check if anything changed to avoid later failure.
33+
# E.g. nothing changes if only CI files are modified which are removed by the above
34+
if git diff --quiet; then
35+
echo "::set-output name=changed::false"
36+
else
37+
echo "::set-output name=changed::true"
38+
fi
2839
- name: Commit and push
40+
if: steps.standalone.outputs.changed == 'true'
2941
run: |
30-
git commit -am "Include '${{github.event.head_commit.message}}'"
42+
git add .
43+
git commit -m "Include '${{github.event.head_commit.message}}'"
3144
remote_repo="https://${GITHUB_ACTOR}:${{secrets.GITHUB_TOKEN}}@github.com/${GITHUB_REPOSITORY}.git"
3245
git push "$remote_repo" HEAD:$STANDALONE_BRANCH_NAME
3346

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Copyright 2017 - 2019 James E. King III
33
# Copyright 2019 - 2020 Alexander Grund
44
# Distributed under the Boost Software License, Version 1.0.
5-
# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt)
5+
# (See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt)
66

77
language: cpp
88
os: linux

CMakeLists.txt

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Copyright 2019 - 2020 Alexander Grund
2+
# Distributed under the Boost Software License, Version 1.0.
3+
# (See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt)
4+
15
# Builds the libraries for Boost.Nowide
26
#
37
# Options:
@@ -11,7 +15,7 @@
1115

1216
cmake_minimum_required(VERSION 3.9)
1317
# Version number starts at 10 to avoid conflicts with Boost version
14-
set(_version 10.0.2)
18+
set(_version 11.0.0)
1519
if(BOOST_SUPERPROJECT_SOURCE_DIR)
1620
set(_version ${BOOST_SUPERPROJECT_VERSION})
1721
endif()
@@ -30,13 +34,17 @@ endif()
3034

3135
include(BoostAddOptions)
3236
include(BoostAddWarnings)
37+
include(CheckCXXSourceCompiles)
3338
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
3439
include(CTest)
3540
endif()
3641

42+
file(READ ${CMAKE_CURRENT_SOURCE_DIR}/test/check_lfs_support.cpp lfsSource)
43+
check_cxx_source_compiles("${lfsSource}" BOOST_NOWIDE_HAS_LFS)
44+
3745
# Using glob here is ok as it is only for headers
3846
file(GLOB_RECURSE headers include/*.hpp)
39-
add_library(boost_nowide src/cstdio.cpp src/cstdlib.cpp src/iostream.cpp ${headers})
47+
add_library(boost_nowide src/cstdio.cpp src/cstdlib.cpp src/filebuf.cpp src/iostream.cpp src/stat.cpp ${headers})
4048
add_library(Boost::nowide ALIAS boost_nowide)
4149
set_target_properties(boost_nowide PROPERTIES
4250
CXX_VISIBILITY_PRESET hidden
@@ -47,18 +55,17 @@ set_target_properties(boost_nowide PROPERTIES
4755
if(BUILD_SHARED_LIBS)
4856
target_compile_definitions(boost_nowide PUBLIC BOOST_NOWIDE_DYN_LINK)
4957
endif()
58+
if(NOT BOOST_NOWIDE_HAS_LFS)
59+
target_compile_definitions(boost_nowide PRIVATE BOOST_NOWIDE_NO_LFS)
60+
endif()
5061
target_compile_definitions(boost_nowide PUBLIC BOOST_NOWIDE_NO_LIB)
5162
target_include_directories(boost_nowide PUBLIC include)
5263
boost_add_warnings(boost_nowide pedantic ${Boost_NOWIDE_WERROR})
64+
target_compile_features(boost_nowide PUBLIC cxx_std_11)
5365

5466
if(BOOST_SUPERPROJECT_SOURCE_DIR)
55-
target_link_libraries(boost_nowide PUBLIC Boost::config Boost::smart_ptr Boost::static_assert)
56-
set(Boost_NOWIDE_INSTALL OFF) # smart_ptr does not support installation
67+
target_link_libraries(boost_nowide PUBLIC Boost::config)
5768
else()
58-
# Default boost libs are static on windows and dynamic on linux
59-
if(WIN32 AND NOT DEFINED Boost_USE_STATIC_LIBS)
60-
set(Boost_USE_STATIC_LIBS ON)
61-
endif()
6269
find_package(Boost 1.56 REQUIRED)
6370
target_link_libraries(boost_nowide PUBLIC Boost::boost)
6471
endif()

Config.cmake.in

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,10 @@ set(_boost_nowide_superproject "@BOOST_SUPERPROJECT_SOURCE_DIR@")
44

55
include(CMakeFindDependencyMacro)
66
if(_boost_nowide_superproject)
7-
foreach(dep IN ITEMS boost_config boost_smart_ptr boost_static_assert)
7+
foreach(dep IN ITEMS boost_config)
88
find_dependency(${dep})
99
endforeach()
1010
else()
11-
# Default boost libs are static on windows and dynamic on linux
12-
if(WIN32 AND "${Boost_USE_STATIC_LIBS}" STREQUAL "")
13-
set(Boost_USE_STATIC_LIBS ON)
14-
endif()
1511
find_dependency(Boost 1.56)
1612
endif()
1713

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,22 @@ Distributed under the [Boost Software License, Version 1.0](http://www.boost.org
1717

1818
### Properties
1919

20-
* C++03 **(will be raised to C++11 by mid 2020)**
21-
* optional C++11/17 support
20+
* optional C++17 (filesystem) support
2221
* Usable outside of Boost via CMake
2322
* Compiled library on every OS
2423

2524
Note on the last point:
2625
Having a compiled library allows cross-platform access to e.g. `setenv` which would not be available when using a `-std=c++nn` flag.
2726
This is different to the version available prior to the inclusion in Boost.
2827

28+
### Requirements (All versions)
29+
30+
* C++11 (or higher) compatible compiler
31+
* MSVC 2015 and up work
32+
* libstdc++ < 5 is unsupported as it is silently lacking C++11 features
33+
2934
### Requirements (Boost version)
3035

31-
* C++03 (or higher) compatible compiler
3236
* Boost (>= 1.56)
3337
* CMake (when not using as part of Boost) or B2 (otherwise)
3438

@@ -38,7 +42,6 @@ The [standalone branch](https://github.com/boostorg/nowide/tree/standalone) keep
3842
It is automatically updated so referring to a specific commit is recommended.
3943
You can also use the standalone source archive which is part of every release.
4044

41-
* C++11 (or higher) compatible compiler
4245
* CMake
4346

4447
# Quickstart

build/Jamfile.v2

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,42 @@
11
# Boost Nowide Library Build Jamfile
22

3-
# (C) Copyright Beman Dawes 2002, 2006, Artyom Beilis 2012
3+
# Copyright (c) 2002, 2006 Beman Dawes
4+
# Copyright (c) 2012 Artyom Beilis (Tonkikh)
5+
# Copyright (c) 2020 Alexander Grund
46
#
5-
67
# Distributed under the Boost Software License, Version 1.0.
7-
# (See accompanying file LICENSE_1_0.txt or www.boost.org/LICENSE_1_0.txt)
8-
8+
# (See accompanying file LICENSE or www.boost.org/LICENSE_1_0.txt)
99
# See library home page at http://www.boost.org/libs/nowide
1010

11+
import ../../config/checks/config : requires ;
12+
13+
local requirements =
14+
<link>shared:<define>BOOST_NOWIDE_DYN_LINK=1
15+
;
16+
17+
obj cxx11_moveable_fstreams : ../test/check_movable_fstreams.cpp ;
18+
explicit cxx11_moveable_fstreams ;
19+
obj lfs_support : ../test/check_lfs_support.cpp ;
20+
explicit lfs_support ;
21+
1122
project boost/nowide
12-
: source-location ../src
13-
: usage-requirements # pass these requirement to dependents (i.e. users)
14-
<link>shared:<define>BOOST_NOWIDE_DYN_LINK=1
15-
;
23+
: source-location ../src
24+
: requirements $(requirements)
25+
[ requires
26+
cxx11_defaulted_functions
27+
cxx11_noexcept
28+
cxx11_rvalue_references
29+
cxx11_static_assert
30+
]
31+
[ check-target-builds cxx11_moveable_fstreams "std::fstream is moveable and swappable" : : <build>no ]
32+
[ check-target-builds lfs_support "Has Large File Support" : : <define>BOOST_NOWIDE_NO_LFS ]
33+
: usage-requirements $(requirements)
34+
;
1635

17-
SOURCES = cstdio cstdlib iostream ;
36+
local SOURCES = cstdio cstdlib filebuf iostream stat ;
1837

1938
lib boost_nowide
20-
: $(SOURCES).cpp
21-
: <link>shared:<define>BOOST_NOWIDE_DYN_LINK=1
22-
;
39+
: $(SOURCES).cpp
40+
;
2341

2442
boost-install boost_nowide ;

0 commit comments

Comments
 (0)