Skip to content

Commit 6f34131

Browse files
authored
Add C++11 support (#119)
1 parent 6ec7699 commit 6f34131

Some content is hidden

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

54 files changed

+1752
-1141
lines changed

.clang-format

+2
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,6 @@ BraceWrapping:
2525
AllowAllConstructorInitializersOnNextLine: true
2626
ConstructorInitializerAllOnOneLineOrOnePerLine: true
2727
AllowShortCaseLabelsOnASingleLine: true
28+
IfMacros:
29+
- RAPIDFUZZ_IF_CONSTEXPR
2830
IndentPPDirectives: AfterHash

.github/workflows/linux-simple.yml

+134
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
name: Linux builds (basic)
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
name: ${{matrix.cxx}}, C++${{matrix.std}}, ${{matrix.build_type}}
8+
runs-on: ubuntu-20.04
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
compiler:
13+
- g++-5
14+
- g++-6
15+
- g++-7
16+
- g++-8
17+
- g++-9
18+
- g++-10
19+
- clang++-6.0
20+
- clang++-7
21+
- clang++-8
22+
- clang++-9
23+
- clang++-10
24+
build_type: [Debug, Release]
25+
std: [11]
26+
include:
27+
- cxx: g++-5
28+
other_pkgs: g++-5
29+
- cxx: g++-6
30+
other_pkgs: g++-6
31+
- cxx: g++-7
32+
other_pkgs: g++-7
33+
- cxx: g++-8
34+
other_pkgs: g++-8
35+
- cxx: g++-9
36+
other_pkgs: g++-9
37+
- cxx: g++-10
38+
other_pkgs: g++-10
39+
- cxx: clang++-6.0
40+
other_pkgs: clang-6.0
41+
- cxx: clang++-7
42+
other_pkgs: clang-7
43+
- cxx: clang++-8
44+
other_pkgs: clang-8
45+
- cxx: clang++-9
46+
other_pkgs: clang-9
47+
- cxx: clang++-10
48+
other_pkgs: clang-10
49+
50+
- cxx: clang++-10
51+
other_pkgs: clang-10
52+
std: 14
53+
build_type: Debug
54+
- cxx: clang++-10
55+
other_pkgs: clang-10
56+
std: 17
57+
build_type: Debug
58+
- cxx: clang++-10
59+
other_pkgs: clang-10
60+
std: 20
61+
build_type: Debug
62+
- cxx: g++-10
63+
other_pkgs: g++-10
64+
std: 14
65+
build_type: Debug
66+
- cxx: g++-10
67+
other_pkgs: g++-10
68+
std: 17
69+
build_type: Debug
70+
- cxx: g++-10
71+
other_pkgs: g++-10
72+
std: 20
73+
build_type: Debug
74+
75+
- cxx: clang++-10
76+
other_pkgs: clang-10
77+
std: 14
78+
build_type: Release
79+
- cxx: clang++-10
80+
other_pkgs: clang-10
81+
std: 17
82+
build_type: Release
83+
- cxx: clang++-10
84+
other_pkgs: clang-10
85+
std: 20
86+
build_type: Release
87+
- cxx: g++-10
88+
other_pkgs: g++-10
89+
std: 14
90+
build_type: Release
91+
- cxx: g++-10
92+
other_pkgs: g++-10
93+
std: 17
94+
build_type: Release
95+
- cxx: g++-10
96+
other_pkgs: g++-10
97+
std: 20
98+
build_type: Release
99+
100+
steps:
101+
- uses: actions/checkout@v4
102+
103+
- name: Add repositories for older GCC
104+
run: |
105+
sudo apt-add-repository 'deb http://azure.archive.ubuntu.com/ubuntu/ bionic main'
106+
sudo apt-add-repository 'deb http://azure.archive.ubuntu.com/ubuntu/ bionic universe'
107+
if: ${{ matrix.cxx == 'g++-5' || matrix.cxx == 'g++-6' }}
108+
109+
- name: Prepare environment
110+
run: |
111+
sudo apt-get update
112+
sudo apt-get install -y ninja-build ${{matrix.other_pkgs}}
113+
114+
- name: Configure CMake
115+
env:
116+
CXX: ${{matrix.cxx}}
117+
run: |
118+
cmake -B build \
119+
-DCMAKE_BUILD_TYPE=${{matrix.build_type}} \
120+
-DCMAKE_CXX_STANDARD=${{matrix.std}} \
121+
-DCMAKE_CXX_STANDARD_REQUIRED=ON \
122+
-DCMAKE_CXX_EXTENSIONS=OFF \
123+
-DRAPIDFUZZ_BUILD_TESTING=1 \
124+
-DRAPIDFUZZ_ENABLE_LINTERS=1 \
125+
-G Ninja
126+
127+
- name: Build
128+
working-directory: build
129+
run: ninja
130+
131+
- name: Test
132+
working-directory: build
133+
run: ctest -C ${{matrix.build_type}} --rerun-failed --output-on-failure -j `nproc`
134+

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
## Changelog
22

3+
## [3.3.0] - 2025-01-18
4+
### Changed
5+
- add C++11 and C++14 support
6+
37
## [3.2.0] - 2024-12-17
48
### Performance
59
- improve calculation of min score inside partial_ratio so it can skip more alignments

CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ if (CMAKE_BINARY_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
3232
message(FATAL_ERROR "Building in-source is not supported! Create a build dir and remove ${CMAKE_SOURCE_DIR}/CMakeCache.txt")
3333
endif()
3434

35-
project(rapidfuzz LANGUAGES CXX VERSION 3.2.0)
35+
project(rapidfuzz LANGUAGES CXX VERSION 3.3.0)
3636

3737
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
3838
include(GNUInstallDirs)
@@ -50,7 +50,7 @@ add_library(rapidfuzz INTERFACE)
5050
# provide a namespaced alias for clients to 'link' against if RapidFuzz is included as a sub-project
5151
add_library(rapidfuzz::rapidfuzz ALIAS rapidfuzz)
5252

53-
target_compile_features(rapidfuzz INTERFACE cxx_std_17)
53+
target_compile_features(rapidfuzz INTERFACE cxx_std_11)
5454

5555
target_include_directories(rapidfuzz
5656
INTERFACE

0 commit comments

Comments
 (0)