Skip to content

Commit

Permalink
Merge branch 'master' into gh-actions
Browse files Browse the repository at this point in the history
  • Loading branch information
brevzin committed May 23, 2023
2 parents 5c33bfd + 9aa41d6 commit bcb953c
Show file tree
Hide file tree
Showing 28 changed files with 261 additions and 94 deletions.
80 changes: 59 additions & 21 deletions .github/workflows/range-v3-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,46 +11,53 @@ jobs:
build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
container: ${{ matrix.config.container }}

strategy:
fail-fast: false
matrix:
config:
# GCC-6
- {
name: "Linux GCC 6 Debug (C++14)", artifact: "Linux.tar.xz",
os: ubuntu-18.04,
os: ubuntu-latest,
container: "ubuntu:18.04",
build_type: Debug,
cc: "gcc-6", cxx: "g++-6",
cxx_standard: 14,
cxx_concepts: false
}
- {
name: "Linux GCC 6 Release (C++14)", artifact: "Linux.tar.xz",
os: ubuntu-18.04,
os: ubuntu-latest,
container: "ubuntu:18.04",
build_type: RelWithDebInfo,
cc: "gcc-6", cxx: "g++-6",
cxx_standard: 14,
cxx_concepts: false
}
- {
name: "Linux GCC 6 Debug (C++17)", artifact: "Linux.tar.xz",
os: ubuntu-18.04,
os: ubuntu-latest,
container: "ubuntu:18.04",
build_type: Debug,
cc: "gcc-6", cxx: "g++-6",
cxx_standard: 17,
cxx_concepts: false
}
- {
name: "Linux GCC 6 Release (C++17)", artifact: "Linux.tar.xz",
os: ubuntu-18.04,
os: ubuntu-latest,
container: "ubuntu:18.04",
build_type: RelWithDebInfo,
cc: "gcc-6", cxx: "g++-6",
cxx_standard: 17,
cxx_concepts: false
}
- {
name: "Linux GCC 6 Release (C++17, Concepts)", artifact: "Linux.tar.xz",
os: ubuntu-18.04,
os: ubuntu-latest,
container: "ubuntu:18.04",
build_type: RelWithDebInfo,
cc: "gcc-6", cxx: "g++-6",
cxx_standard: 17,
Expand All @@ -59,39 +66,44 @@ jobs:
# GCC-7
- {
name: "Linux GCC 7 Debug (C++14)", artifact: "Linux.tar.xz",
os: ubuntu-18.04,
os: ubuntu-latest,
container: "ubuntu:18.04",
build_type: Debug,
cc: "gcc-7", cxx: "g++-7",
cxx_standard: 14,
cxx_concepts: false
}
- {
name: "Linux GCC 7 Release (C++14)", artifact: "Linux.tar.xz",
os: ubuntu-18.04,
os: ubuntu-latest,
container: "ubuntu:18.04",
build_type: RelWithDebInfo,
cc: "gcc-7", cxx: "g++-7",
cxx_standard: 14,
cxx_concepts: false
}
- {
name: "Linux GCC 7 Debug (C++17)", artifact: "Linux.tar.xz",
os: ubuntu-18.04,
os: ubuntu-latest,
container: "ubuntu:18.04",
build_type: Debug,
cc: "gcc-7", cxx: "g++-7",
cxx_standard: 17,
cxx_concepts: false
}
- {
name: "Linux GCC 7 Release (C++17)", artifact: "Linux.tar.xz",
os: ubuntu-18.04,
os: ubuntu-latest,
container: "ubuntu:18.04",
build_type: RelWithDebInfo,
cc: "gcc-7", cxx: "g++-7",
cxx_standard: 17,
cxx_concepts: false
}
- {
name: "Linux GCC 7 Release (C++17, Concepts)", artifact: "Linux.tar.xz",
os: ubuntu-18.04,
os: ubuntu-latest,
container: "ubuntu:18.04",
build_type: RelWithDebInfo,
cc: "gcc-7", cxx: "g++-7",
cxx_standard: 17,
Expand All @@ -100,39 +112,44 @@ jobs:
# GCC-8
- {
name: "Linux GCC 8 Debug (C++14)", artifact: "Linux.tar.xz",
os: ubuntu-18.04,
os: ubuntu-latest,
container: "ubuntu:18.04",
build_type: Debug,
cc: "gcc-8", cxx: "g++-8",
cxx_standard: 14,
cxx_concepts: false
}
- {
name: "Linux GCC 8 Release (C++14)", artifact: "Linux.tar.xz",
os: ubuntu-18.04,
os: ubuntu-latest,
container: "ubuntu:18.04",
build_type: RelWithDebInfo,
cc: "gcc-8", cxx: "g++-8",
cxx_standard: 14,
cxx_concepts: false
}
- {
name: "Linux GCC 8 Debug (C++17)", artifact: "Linux.tar.xz",
os: ubuntu-18.04,
os: ubuntu-latest,
container: "ubuntu:18.04",
build_type: Debug,
cc: "gcc-8", cxx: "g++-8",
cxx_standard: 17,
cxx_concepts: false
}
- {
name: "Linux GCC 8 Release (C++17)", artifact: "Linux.tar.xz",
os: ubuntu-18.04,
os: ubuntu-latest,
container: "ubuntu:18.04",
build_type: RelWithDebInfo,
cc: "gcc-8", cxx: "g++-8",
cxx_standard: 17,
cxx_concepts: false
}
- {
name: "Linux GCC 8 Release (C++17, Concepts)", artifact: "Linux.tar.xz",
os: ubuntu-18.04,
os: ubuntu-latest,
container: "ubuntu:18.04",
build_type: RelWithDebInfo,
cc: "gcc-8", cxx: "g++-8",
cxx_standard: 17,
Expand Down Expand Up @@ -236,7 +253,8 @@ jobs:
# Clang-5.0
- {
name: "Linux Clang 5.0 Debug (C++14 / libc++ / ASAN)", artifact: "Linux.tar.xz",
os: ubuntu-18.04,
os: ubuntu-latest,
container: "ubuntu:18.04",
build_type: Debug,
cc: "clang-5.0", cxx: "clang++-5.0",
cxx_standard: 14,
Expand All @@ -245,7 +263,8 @@ jobs:
}
- {
name: "Linux Clang 5.0 Debug (C++17 / ASAN)", artifact: "Linux.tar.xz",
os: ubuntu-18.04,
os: ubuntu-latest,
container: "ubuntu:18.04",
build_type: Debug,
cc: "clang-5.0", cxx: "clang++-5.0",
cxx_standard: 17,
Expand All @@ -255,7 +274,8 @@ jobs:
# Clang-6.0
- {
name: "Linux Clang 6.0 Debug (C++14 / libc++ / ASAN)", artifact: "Linux.tar.xz",
os: ubuntu-18.04,
os: ubuntu-latest,
container: "ubuntu:18.04",
build_type: Debug,
cc: "clang-6.0", cxx: "clang++-6.0",
cxx_standard: 14,
Expand All @@ -264,7 +284,8 @@ jobs:
}
- {
name: "Linux Clang 6.0 Debug (C++17 / ASAN)", artifact: "Linux.tar.xz",
os: ubuntu-18.04,
os: ubuntu-latest,
container: "ubuntu:18.04",
build_type: Debug,
cc: "clang-6.0", cxx: "clang++-6.0",
cxx_standard: 17,
Expand All @@ -275,6 +296,7 @@ jobs:
- {
name: "Linux Clang 8 Debug (C++14 / libc++ / ASAN)", artifact: "Linux.tar.xz",
os: ubuntu-latest,
container: "ubuntu:18.04",
build_type: Debug,
cc: "clang-8", cxx: "clang++-8",
cxx_standard: 14,
Expand All @@ -283,7 +305,7 @@ jobs:
}
- {
name: "Linux Clang 8 Debug (C++17 / ASAN)", artifact: "Linux.tar.xz",
os: ubuntu-latest,
os: ubuntu-20.04,
build_type: Debug,
cc: "clang-8", cxx: "clang++-8",
cxx_standard: 17,
Expand All @@ -294,6 +316,7 @@ jobs:
- {
name: "Linux Clang 9 Debug (C++17 / ASAN)", artifact: "Linux.tar.xz",
os: ubuntu-latest,
container: "ubuntu:18.04",
build_type: Debug,
cc: "clang-9", cxx: "clang++-9",
cxx_standard: 17,
Expand All @@ -302,6 +325,7 @@ jobs:
- {
name: "Linux Clang 9 Release (C++17)", artifact: "Linux.tar.xz",
os: ubuntu-latest,
container: "ubuntu:18.04",
build_type: RelWithDebInfo,
cc: "clang-9", cxx: "clang++-9",
cxx_standard: 17,
Expand All @@ -318,6 +342,7 @@ jobs:
- {
name: "Linux Clang 10 Debug (C++20 / ASAN)", artifact: "Linux.tar.xz",
os: ubuntu-latest,
container: "ubuntu:18.04",
build_type: Debug,
cc: "clang-10", cxx: "clang++-10",
cxx_standard: 20,
Expand All @@ -327,6 +352,7 @@ jobs:
- {
name: "Linux Clang 10 Release (C++20 / Concepts)", artifact: "Linux.tar.xz",
os: ubuntu-latest,
container: "ubuntu:18.04",
build_type: RelWithDebInfo,
cc: "clang-10", cxx: "clang++-10",
cxx_standard: 20,
Expand Down Expand Up @@ -499,7 +525,19 @@ jobs:
}

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3

- name: Setup container environment
if: matrix.config.container
run: |
apt-get update
apt-get -y install sudo python git g++ cmake curl
- name: Install packages
if: matrix.install
run: |
sudo apt-get update
sudo apt-get -y install ${{matrix.install}}
- name: Download Ninja and CMake
id: cmake_and_ninja
Expand Down
50 changes: 26 additions & 24 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -162,27 +162,29 @@ if(NOT RANGE_V3_NEW_VERSION_HPP STREQUAL RANGE_V3_OLD_VERSION_HPP)
message(STATUS " conan upload --all range-v3/${RANGE_V3_VERSION}@ericniebler/stable -r=range-v3")
endif()

include(CMakePackageConfigHelpers)

# write_basic_package_version_file(...) gained ARCH_INDEPENDENT in CMake 3.14.
# For CMake 3.6, this workaround makes the version file ARCH_INDEPENDENT
# by making CMAKE_SIZEOF_VOID_P empty.
set(OLD_CMAKE_SIZEOF_VOID_P ${CMAKE_SIZEOF_VOID_P})
set(CMAKE_SIZEOF_VOID_P "")
write_basic_package_version_file(
${CMAKE_CURRENT_BINARY_DIR}/range-v3-config-version.cmake
VERSION ${RANGE_V3_VERSION}
COMPATIBILITY ExactVersion
)
set(CMAKE_SIZEOF_VOID_P ${OLD_CMAKE_SIZEOF_VOID_P})

include(GNUInstallDirs)
install(TARGETS range-v3-concepts range-v3-meta range-v3 EXPORT range-v3-targets DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(EXPORT range-v3-targets FILE range-v3-targets.cmake DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/range-v3)
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/range-v3-config-version.cmake
cmake/range-v3-config.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/range-v3)
install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} FILES_MATCHING PATTERN "*")

export(EXPORT range-v3-targets FILE range-v3-config.cmake)
if (RANGE_V3_INSTALL)
include(CMakePackageConfigHelpers)

# write_basic_package_version_file(...) gained ARCH_INDEPENDENT in CMake 3.14.
# For CMake 3.6, this workaround makes the version file ARCH_INDEPENDENT
# by making CMAKE_SIZEOF_VOID_P empty.
set(OLD_CMAKE_SIZEOF_VOID_P ${CMAKE_SIZEOF_VOID_P})
set(CMAKE_SIZEOF_VOID_P "")
write_basic_package_version_file(
${CMAKE_CURRENT_BINARY_DIR}/range-v3-config-version.cmake
VERSION ${RANGE_V3_VERSION}
COMPATIBILITY ExactVersion
)
set(CMAKE_SIZEOF_VOID_P ${OLD_CMAKE_SIZEOF_VOID_P})

include(GNUInstallDirs)
install(TARGETS range-v3-concepts range-v3-meta range-v3 EXPORT range-v3-targets DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(EXPORT range-v3-targets FILE range-v3-targets.cmake DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/range-v3)
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/range-v3-config-version.cmake
cmake/range-v3-config.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/range-v3)
install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} FILES_MATCHING PATTERN "*")

export(EXPORT range-v3-targets FILE range-v3-config.cmake)
endif()
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Range library for C++14/17/20. This code was the basis of [a formal proposal](ht
About:
------

Ranges are an extension of the Standard Template Library that makes its iterators and algorithms more powerful by making them _composable_. Unlike other range-like solutions which seek to do away with iterators, in range-v3 ranges are an abstration layer _on top_ of iterators.
Ranges are an extension of the Standard Template Library that makes its iterators and algorithms more powerful by making them _composable_. Unlike other range-like solutions which seek to do away with iterators, in range-v3 ranges are an abstraction layer _on top_ of iterators.

Range-v3 is built on three pillars: Views, Actions, and Algorithms. The algorithms are the same as those with which you are already familiar in the STL, except that in range-v3 all the algorithms have overloads that take ranges in addition to the overloads that take iterators. Views are composable adaptations of ranges where the adaptation happens lazily as the view is iterated. And an action is an eager application of an algorithm to a container that mutates the container in-place and returns it for further processing.

Expand Down Expand Up @@ -71,13 +71,13 @@ Building range-v3 - Using vcpkg
-------------------------------

You can download and install range-v3 using the [vcpkg](https://github.com/Microsoft/vcpkg) dependency manager:

git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.sh
./vcpkg integrate install
./vcpkg install range-v3

```sh
git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.sh
./vcpkg integrate install
./vcpkg install range-v3
```
The range-v3 port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please [create an issue or pull request](https://github.com/Microsoft/vcpkg) on the vcpkg repository.

Building range-v3 - Using Conan
Expand All @@ -86,7 +86,7 @@ Building range-v3 - Using Conan
You can download and install range-v3 using the [Conan](https://github.com/conan-io/conan) dependency manager.

Setup your CMakeLists.txt (see [Conan documentation](https://docs.conan.io/en/latest/integrations/build_system.html) on how to use MSBuild, Meson and others):
```
```cmake
project(myproject CXX)
add_executable(${PROJECT_NAME} main.cpp)
Expand All @@ -97,15 +97,15 @@ conan_basic_setup(TARGETS) # Introduce Conan-generated targets
target_link_libraries(${PROJECT_NAME} CONAN_PKG::range-v3)
```
Create `conanfile.txt` in your source dir:
```
```sh
[requires]
range-v3/0.12.0

[generators]
cmake
```
Install and run `conan`, then build your project as always:
```
```sh
pip install conan
mkdir build
cd build
Expand Down Expand Up @@ -141,7 +141,7 @@ For example, to make your `build2` project depend on `range-v3`:
depends: range-v3 ~0.11.0
```
- Import the target and use it as a prerequisite to your own target using `range-v3` in the appropriate `buildfile`:
```
```py
import range_v3 = range-v3%lib{range-v3}

lib{mylib} : cxx{**} ... $range_v3
Expand Down
Loading

0 comments on commit bcb953c

Please sign in to comment.