Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
* develop:
  test: Add more basic cases for image class (#423)
  test: Add virtual_2d_locator fixture; is_2d_traversable test case
  test: Check more properties of indexed_image_view from extension/toolbox
  test: Add basic is_1d_traversable cases for image_view
  chore: Update CMakeSettings.json sample [ci skip]
  chore: Update CMake to use latest cmake-conan/0.18.1 [ci skip]
  Add pmr image typedefs (#529)
  test: Add test cases for image with empty dimensions (#702)
  test: Case test_constructor_from_view was not called
  fix: Memory leak in image class for empty dimensions (#649)
  docs: Bump C++11 to C++14 as current required (#700)
  ci: Remove C++11 build jobs after C++14 switch (#698)
  build: Fix CMake source file extensions must be explicit
  refactor: Switch to trailing return types (#599)
  build: Bump Boost required by CMake from 1.72 to 1.80
  build: Update CMAKE_CXX_STANDARD from 11 to 14
  • Loading branch information
mloskot committed Jun 29, 2022
2 parents b29f3da + 2409be4 commit bba6d62
Show file tree
Hide file tree
Showing 114 changed files with 1,443 additions and 713 deletions.
14 changes: 1 addition & 13 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#
version: 1.0.{build}-{branch}

# Current Boost.GIL develop branch (future Boost 1.68) requires C++11
# Current Boost.GIL develop branch requires C++14
# Since VS2017, MSVC default is /std:c++14, so no explicit switch is required.
image: Visual Studio 2017

Expand All @@ -17,18 +17,6 @@ shallow_clone: true

environment:
matrix:
- TOOLSET: msvc-14.0
ARCH: x86_64
VARIANT: debug
CXXSTD: 11
TEST_HEADERS: 1
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
- TOOLSET: msvc-14.0
ARCH: x86_64
VARIANT: release
CXXSTD: 11
TEST_HEADERS: 1
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
- TOOLSET: msvc-14.1
ARCH: x86_64
VARIANT: debug
Expand Down
2 changes: 1 addition & 1 deletion .ci/azure-pipelines/steps-cmake-build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
parameters:
# defaults, if not specified
configuration: 'Release'
cxxver: '11'
cxxver: '14'
enable_ext_io: 'OFF'
enable_ext_numeric: 'ON'
enable_ext_toolbox: 'ON'
Expand Down
30 changes: 15 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,64 +19,64 @@ jobs:
matrix:
include:
- toolset: gcc-6
cxxstd: "11,14,1z"
cxxstd: "14,1z"
os: ubuntu-18.04
install: g++-6
- toolset: gcc-7
cxxstd: "11,14,17"
cxxstd: "14,17"
os: ubuntu-18.04
- toolset: gcc
compiler: g++-8
cxxstd: "11,14"
cxxstd: "14"
os: ubuntu-18.04
install: g++-8
- toolset: gcc-9
cxxstd: "11,14,17"
cxxstd: "14,17"
os: ubuntu-18.04
- toolset: gcc-10
cxxstd: "11,14,17"
cxxstd: "14,17"
os: ubuntu-18.04
- toolset: clang
compiler: clang++-3.9
cxxstd: "11,14"
cxxstd: "14"
os: ubuntu-18.04
install: clang-3.9
- toolset: clang
compiler: clang++-4.0
cxxstd: "11,14"
cxxstd: "14"
os: ubuntu-18.04
install: clang-4.0
- toolset: clang
compiler: clang++-5.0
cxxstd: "11,14,1z"
cxxstd: "14,1z"
os: ubuntu-18.04
install: clang-5.0
- toolset: clang
compiler: clang++-6.0
cxxstd: "11,14,17"
cxxstd: "14,17"
os: ubuntu-18.04
install: clang-6.0
- toolset: clang
compiler: clang++-7
cxxstd: "11,14,17"
cxxstd: "14,17"
os: ubuntu-18.04
install: clang-7
- toolset: clang
compiler: clang++-8
cxxstd: "11,14,17"
cxxstd: "14,17"
os: ubuntu-20.04
install: clang-8
- toolset: clang
compiler: clang++-9
cxxstd: "11,14,17"
cxxstd: "14,17"
os: ubuntu-20.04
install: clang-9
- toolset: clang
compiler: clang++-10
cxxstd: "11,14,17"
cxxstd: "14,17"
os: ubuntu-20.04
- toolset: clang
cxxstd: "11,14,17"
cxxstd: "14,17"
os: macos-10.15

runs-on: ${{matrix.os}}
Expand Down Expand Up @@ -129,7 +129,7 @@ jobs:
addrmd: 32,64
os: windows-2019
- toolset: gcc
cxxstd: "11,14,17"
cxxstd: "14,17"
addrmd: 64
os: windows-2019
- toolset: msvc-14.3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
- name: Run tests
run: |
cd ../boost-root
./b2 -j3 libs/$LIBRARY/test coverage=on toolset=gcc cxxstd=11 variant=debug
./b2 -j3 libs/$LIBRARY/test coverage=on toolset=gcc cxxstd=14 variant=debug
lcov --directory bin.v2 --capture --no-external --directory $(pwd) --output-file coverage.info > /dev/null 2>&1
lcov --extract coverage.info $(pwd)'/boost/gil/*' --output-file coverage.info > /dev/null
lcov --list coverage.info
Expand Down
10 changes: 5 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ target_link_libraries(boost_gil
Boost::variant2
)

target_compile_features(boost_gil INTERFACE cxx_std_11)
target_compile_features(boost_gil INTERFACE cxx_std_14)

else()

Expand All @@ -60,14 +60,14 @@ option(BOOST_GIL_ENABLE_EXT_RASTERIZATION "Enable Rasterization extension and te
option(BOOST_GIL_ENABLE_EXT_IMAGE_PROCESSING "Enable Image Processing extension (!) and tests" ON)
option(BOOST_GIL_USE_CONAN "Use Conan to install dependencies" OFF)
option(BOOST_GIL_USE_CLANG_TIDY "Set CMAKE_CXX_CLANG_TIDY property on targets to enable clang-tidy linting" OFF)
set(CMAKE_CXX_STANDARD 11 CACHE STRING "C++ standard version to use (default is 11)")
set(CMAKE_CXX_STANDARD 14 CACHE STRING "C++ standard version to use (default is 14)")

#-----------------------------------------------------------------------------
# Project
#-----------------------------------------------------------------------------
project(Boost.GIL
LANGUAGES CXX
DESCRIPTION "Boost.GIL - Generic Image Library | Requires C++11 since Boost 1.68")
DESCRIPTION "Boost.GIL - Generic Image Library | Requires C++14 since Boost 1.80")

list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_BINARY_DIR}/cmake)

Expand Down Expand Up @@ -140,7 +140,7 @@ if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
set(Boost_USE_STATIC_RUNTIME OFF)
endif()

find_package(Boost 1.72.0 REQUIRED COMPONENTS filesystem)
find_package(Boost 1.80.0 REQUIRED COMPONENTS filesystem)
message(STATUS "Boost.GIL: Using Boost_INCLUDE_DIRS=${Boost_INCLUDE_DIRS}")
message(STATUS "Boost.GIL: Using Boost_LIBRARY_DIRS=${Boost_LIBRARY_DIRS}")

Expand All @@ -161,7 +161,7 @@ if(BOOST_GIL_USE_CONAN)
# Download automatically, you can also just copy the conan.cmake file
if(NOT EXISTS "${CMAKE_BINARY_DIR}/conan.cmake")
message(STATUS "Boost.GIL: Downloading conan.cmake from https://github.com/conan-io/cmake-conan")
file(DOWNLOAD "https://raw.githubusercontent.com/conan-io/cmake-conan/v0.15/conan.cmake"
file(DOWNLOAD "https://raw.githubusercontent.com/conan-io/cmake-conan/0.18.1/conan.cmake"
"${CMAKE_BINARY_DIR}/conan.cmake")
endif()

Expand Down
54 changes: 28 additions & 26 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ please follow the workflow explained in this document.

## Prerequisites

- C++11 compiler
- C++14 compiler
- Build and run-time dependencies for tests and examples:
- Boost.Filesystem
- Boost.Test
Expand Down Expand Up @@ -359,25 +359,25 @@ Run core tests only specifying location of directory with tests:
```shell
cd libs/gil
b2 cxxstd=11 test/core
b2 cxxstd=14 test/core
```
Run all tests for selected extension (from Boost root directory, as alternative):
```shell
b2 cxxstd=11 libs/gil/test/extension/dynamic_image
b2 cxxstd=11 libs/gil/test/extension/io
b2 cxxstd=11 libs/gil/test/extension/numeric
b2 cxxstd=11 libs/gil/test/extension/toolbox
b2 cxxstd=14 libs/gil/test/extension/dynamic_image
b2 cxxstd=14 libs/gil/test/extension/io
b2 cxxstd=14 libs/gil/test/extension/numeric
b2 cxxstd=14 libs/gil/test/extension/toolbox
```
Run I/O extension tests bundled in target called `simple`:
```shell
b2 cxxstd=11 libs/gil/test/io//simple
b2 cxxstd=14 libs/gil/test/io//simple
```
**TIP:** Pass `b2` feature `cxxstd=11,14,17,2a` to request compilation for
**TIP:** Pass `b2` feature `cxxstd=14,17,2a` to request compilation for
multiple C++ standard versions in single build run.
### Using CMake
Expand Down Expand Up @@ -405,17 +405,17 @@ The provided CMake configuration allows a couple of ways to develop Boost.GIL:
For CMake, you only need to build Boost libraries required by Boost.Test library
which is used to run GIL tests. Since the `CMAKE_CXX_STANDARD` option in the current
[CMakeLists.txt](CMakeLists.txt) defaults to C++11, pass the default `cxxstd=11` to `b2`:
[CMakeLists.txt](CMakeLists.txt) defaults to C++14, pass the default `cxxstd=14` to `b2`:
```shell
./b2 headers
./b2 variant=debug,release cxxstd=11 --with-filesystem stage
./b2 variant=debug,release cxxstd=14 --with-filesystem stage
```
or, depending on specific requirements, more complete build:
```shell
./b2 variant=debug,release address-model=32,64 cxxstd=11 --layout=versioned --with-filesystem stage
./b2 variant=debug,release address-model=32,64 cxxstd=14 --layout=versioned --with-filesystem stage
```
If you wish to build tests using different C++ standard version, then adjust the `cxxstd` accordingly.
Expand Down Expand Up @@ -447,50 +447,52 @@ Here is an example of such lightweight workflow in Linux environment (Debian-bas
- Configure build with CMake
```shell
mkdir _build
cd _build/
cmake ..
cmake -S . -B _build -DBoost_ADDITIONAL_VERSIONS=1.80 -DBoost_COMPILER=-gcc11 -DBoost_ARCHITECTURE=-x64
```
**TIP:** By default, tests and [examples](example/README.md) are compiled using
the minimum required C++11.
Specify `-DCMAKE_CXX_STANDARD=14|17|20` to use newer version.
By default, tests and [examples](example/README.md) are compiled using
the minimum required C++14.
Specify `-DCMAKE_CXX_STANDARD=17|20` to use newer version.
For more CMake options available for GIL, check `option`-s defined
in the top-level `CMakeLists.txt`.
**TIP:** If CMake is failing to find Boost libraries, especially built
with `--layout=versioned`, you can try a few hacks:
- option `-DBoost_ARCHITECTURE=-x64` to help CMake find Boost 1.66 and above
add an architecture tag to the library file names in versioned build
The option added in CMake 3.13.0.
CMake is failing to find Boost libraries, especially built with `--layout=versioned`,
you can try a few hacks as displayed in the command above:
- option `-DBoost_COMPILER=-gcc5` or `-DBoost_COMPILER=-vc141` to help CMake earlier
than 3.13 match your compiler with toolset used in the Boost library file names
(i.e. `libboost_filesystem-gcc5-mt-x64-1_69` and not `-gcc55-`).
Fixed in CMake 3.13.0.
- option `-DBoost_ARCHITECTURE=-x64` to help CMake find Boost 1.66 and above
add an architecture tag to the library file names in versioned build
The option added in CMake 3.13.0.
- option `-DDBoost_ADDITIONAL_VERSIONS=<unreleased Boost version>` is especially usefull
when testing GIL with staged build of Boost from its `develop` branch.
- if CMake is still failing to find Boost, you may try `-DBoost_DEBUG=ON` to
get detailed diagnostics output from `FindBoost.cmake` module.
- List available CMake targets
```shell
cmake --build . --target help
cmake --build _build --target help
```
- Build selected target with CMake
```shell
cmake --build . --target gil_test_pixel
cmake --build _build --target gil_test_pixel
```
- List available CTest targets
```shell
cd __build
ctest --show-only | grep Test
```
- Run selected test with CTest
```shell
cd __build
ctest -R gil.tests.core.pixel
```
Expand Down Expand Up @@ -567,10 +569,10 @@ Thus, below a few basic guidelines are listed.
First and foremost, make sure you are familiar with the official
[Boost Library Requirements and Guidelines](https://www.boost.org/development/requirements.html).
Second, strive for writing idiomatic C++11, clean and elegant code.
Second, strive for writing idiomatic C++14, clean and elegant code.
**NOTE:** *The Boost.GIL source code does not necessary represent clean and elegant
code to look up to. The library has recently entered the transition to C++11.
code to look up to. The library has recently entered the transition to C++14.
Major refactoring overhaul is ongoing.*
Maintain structure your source code files according to the following guidelines:
Expand Down
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Documentation | GitHub Actions | AppVeyor | Azure Pipelines | Regression | Codec

Boost.GIL is a part of the [Boost C++ Libraries](http://github.com/boostorg).

The Boost Generic Image Library (GIL) is a **C++11** header-only library that abstracts image
The Boost Generic Image Library (GIL) is a **C++14** header-only library that abstracts image
representations from algorithms and allows writing code that can work on a
variety of images with performance similar to hand-writing for a specific image type.

Expand All @@ -52,11 +52,9 @@ See [example/cmake/README.md](example/cmake/README.md) for CMake configuration e

## Requirements

**NOTE:** The library source code is currently being modernized for C++11.

The Boost Generic Image Library (GIL) requires:

- C++11 compiler (GCC 4.9, clang 3.3, MSVC++ 14.0 (1900) or any later version)
- C++14 compiler (GCC 6, clang 3.9, MSVC++ 14.1 (1910) or any later version)
- Boost header-only libraries

Optionally, in order to build and run tests and examples:
Expand Down
5 changes: 3 additions & 2 deletions conanfile.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2018-2021 Mateusz Loskot <mateusz at loskot dot net>
# Copyright (c) 2018-2022 Mateusz Loskot <mateusz at loskot dot net>
#
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
Expand All @@ -11,4 +11,5 @@ libpng/1.6.37
libtiff/4.1.0

[generators]
cmake
CMakeDeps
CMakeToolchain
2 changes: 1 addition & 1 deletion doc/index.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Boost Generic Image Library
===========================

The Generic Image Library (GIL) is a C++11 header-only library that abstracts image
The Generic Image Library (GIL) is a C++14 header-only library that abstracts image
representations from algorithms and allows writing code that can work on
a variety of images with performance similar to hand-writing for a specific
image type.
Expand Down
6 changes: 2 additions & 4 deletions doc/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,11 @@ Compiling
---------

The Boost.GIL library source code should successfully compile with any
compiler with complete C++11 support.
compiler with complete C++14 support.

.. note::

We are planning to drop support for require C++14 support in Boost 1.76 or later,
or selectively drop support for GCC 5 due to its issues with inheriting constructors,
see `discussion for PR #526 <https://github.com/boostorg/gil/pull/526>`_.
Boost.GIL requires C++14 compiler since ince Boost 1.80.

For the actual list of currently tested compilers, check results of the library CI
builds linked from the `README.md <https://github.com/boostorg/gil/blob/develop/README.md>`_
Expand Down
Loading

0 comments on commit bba6d62

Please sign in to comment.