Skip to content

Commit e3d4135

Browse files
committed
change default C++ to 20
Now that older platforms are going away, we can migrate. Also get rid of std::filesystem handling. Not needed with newer compilers. Signed-off-by: Rosen Penev <[email protected]>
1 parent f808a33 commit e3d4135

File tree

4 files changed

+27
-27
lines changed

4 files changed

+27
-27
lines changed

.github/workflows/on_PR_meson.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
env:
4747
CXXFLAGS: -stdlib=libc++
4848
run: |
49-
meson setup "${{github.workspace}}/build" --wrap-mode=${{matrix.deps}} -Dwarning_level=3 -Dcpp_std=c++20
49+
meson setup "${{github.workspace}}/build" --wrap-mode=${{matrix.deps}} -Dwarning_level=3
5050
meson compile -C "${{github.workspace}}/build" --verbose
5151
meson test -C "${{github.workspace}}/build" --verbose
5252
VisualStudio:
@@ -124,7 +124,7 @@ jobs:
124124
125125
- name: Compile and Test
126126
run: |
127-
meson setup "${{github.workspace}}/build" -Dauto_features=${{matrix.deps}} -Dwarning_level=3 -Dcpp_std=c++20
127+
meson setup "${{github.workspace}}/build" -Dauto_features=${{matrix.deps}} -Dwarning_level=3
128128
meson compile -C "${{github.workspace}}/build" --verbose
129129
meson test -C "${{github.workspace}}/build" --verbose
130130
MSYS:
@@ -163,7 +163,7 @@ jobs:
163163
164164
- name: Compile and Test
165165
run: |
166-
meson setup "${{github.workspace}}/build" -Dauto_features=${{matrix.deps}} -Dwarning_level=3 -Dcpp_std=c++20 -Dnls=disabled -Db_sanitize=address,undefined
166+
meson setup "${{github.workspace}}/build" -Dauto_features=${{matrix.deps}} -Dwarning_level=3 -Dnls=disabled -Db_sanitize=address,undefined
167167
meson compile -C "${{github.workspace}}/build" --verbose
168168
meson test -C "${{github.workspace}}/build" --verbose
169169
FreeBSD:
@@ -175,7 +175,7 @@ jobs:
175175
prepare: |
176176
pkg install -y cmake curl ninja meson gettext pkgconf googletest expat inih brotli libfmt
177177
run: |
178-
meson setup "${{github.workspace}}/build" -Dwarning_level=3 -Dcpp_std=c++20
178+
meson setup "${{github.workspace}}/build" -Dwarning_level=3
179179
meson compile -C "${{github.workspace}}/build" --verbose
180180
meson test -C "${{github.workspace}}/build" --verbose
181181
Emscripten:
@@ -189,5 +189,5 @@ jobs:
189189
uses: mymindstorm/setup-emsdk@v14
190190
- name: Compile
191191
run: |
192-
meson setup "${{github.workspace}}/build" --cross-file="${{github.workspace}}/em.txt" --wrap-mode=forcefallback -Ddefault_library=static -Dwarning_level=3 -Dcpp_std=c++20 -DunitTests=disabled -Dcurl=disabled
192+
meson setup "${{github.workspace}}/build" --cross-file="${{github.workspace}}/em.txt" --wrap-mode=forcefallback -Ddefault_library=static -Dwarning_level=3 -DunitTests=disabled -Dcurl=disabled
193193
meson compile -C "${{github.workspace}}/build" --verbose

README.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ The file ReadMe.txt in a build bundle describes how to install the library on th
7474

7575
# Building, Installing, Using and Uninstalling Exiv2
7676

77-
You need [CMake](https://cmake.org/download/) to configure the Exiv2 project, any C++ compiler implementing the C++ 17 standard and the associated tool chain.
77+
You need [CMake](https://cmake.org/download/) to configure the Exiv2 project, any C++ compiler implementing the C++ 20 standard and the associated tool chain.
7878

7979
<div id="B_I_U_Unix">
8080

@@ -88,7 +88,7 @@ $ ctest --test-dir build --verbose # Run tests
8888
$ sudo cmake --install build # Run the install target (install library, public headers, application and CMake files)
8989
```
9090

91-
This will install the library into the "standard locations". The library will be installed in `/usr/local/lib`, executables (including the exiv2 command-line program) in `/usr/local/bin/` and header files in `/usr/local/include/exiv2`. The target directory for the installation can be modified by using the CMake option `-DCMAKE_INSTALL_PREFIX`.
91+
This will install the library into the "standard locations". The library will be installed in `/usr/local/lib`, executables (including the exiv2 command-line program) in `/usr/local/bin/` and header files in `/usr/local/include/exiv2`. The target directory for the installation can be modified by using the CMake option `-DCMAKE_INSTALL_PREFIX`.
9292

9393
CMake analyzes the project configuration from the source code directory and generates files into the build directory. It generates the project/solution/makefiles required to build the exiv2 library and command line application (and optionally sample applications and test runners). CMake also creates the files `exv_conf.h` and `exiv2lib_export.h` which contain compiler directives about the build options you have chosen and the availability of libraries on your machine.
9494

@@ -190,7 +190,7 @@ Preset CMake variables:
190190
-- Conan: checking conan executable
191191
-- Conan: Found program C:/dev/envs/conan/Scripts/conan.exe
192192
-- Conan: Version found Conan version 1.47.0
193-
-- Conan executing: C:/dev/envs/conan/Scripts/conan.exe install .. --remote conancenter --build missing --options webready=True --settings arch=x86_64 --settings build_type=Release --settings compiler=Visual Studio --settings compiler.version=17 --settings compiler.runtime=MD
193+
-- Conan executing: C:/dev/envs/conan/Scripts/conan.exe install .. --remote conancenter --build missing --options webready=True --settings arch=x86_64 --settings build_type=Release --settings compiler=Visual Studio --settings compiler.version=20 --settings compiler.runtime=MD
194194
...
195195

196196
# CMake finds the project dependencies which were automatically handled by conan
@@ -206,7 +206,7 @@ Preset CMake variables:
206206
-- CMake Generator: Ninja
207207
-- CMAKE_BUILD_TYPE: Release
208208
-- Compiler info: MSVC (C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.30.30705/bin/Hostx64/x64/cl.exe) ; version: 19.30.30705.0
209-
-- CMAKE_CXX_STANDARD:17
209+
-- CMAKE_CXX_STANDARD:20
210210
-- --- Compiler flags ---
211211
-- General: /DWIN32 /D_WINDOWS /W3 /GR /EHsc
212212
/MP
@@ -298,7 +298,7 @@ The library libiconv is a GNU library and we do not recommend using libiconv wit
298298

299299
Exiv2 includes the file cmake/FindIconv.cmake which contains a guard to prevent CMake from finding libiconv when you build with Visual Studio. This was added because of issues reported when Visual Studio attempted to link libiconv libraries installed by Cygwin, or MinGW or gnuwin32. [https://github.com/Exiv2/exiv2/issues/1250](https://github.com/Exiv2/exiv2/issues/1250)
300300

301-
There are build instructions about Visual Studio in libiconv-1.16/INSTALL.window require you to install Cygwin. There is an article here about building libiconv with Visual Studio. [https://www.codeproject.com/Articles/302012/How-to-Build-libiconv-with-Microsoft-Visual-Studio](https://www.codeproject.com/Articles/302012/How-to-Build-libiconv-with-Microsoft-Visual-Studio).
301+
There are build instructions about Visual Studio in libiconv-1.16/INSTALL.window require you to install Cygwin. There is an article here about building libiconv with Visual Studio. [https://www.codeproject.com/Articles/302012/How-to-Build-libiconv-with-Microsoft-Visual-Studio](https://www.codeproject.com/Articles/302012/How-to-Build-libiconv-with-Microsoft-Visual-Studio).
302302

303303
If you wish to use libiconv with Visual Studio you will have to build libiconv and remove the "guard" in cmake/FindIconv.cmake. Team Exiv2 will not provide support concerning libiconv and Visual Studio.
304304

@@ -326,7 +326,7 @@ In general you need to do the following:
326326
The following is a typical command to build and link with libexiv2:
327327

328328
```bash
329-
$ g++ -std=c++17 myprog.cpp -o myprog -I/usr/local/include -L/usr/local/lib -lexiv2
329+
$ g++ -std=c++20 myprog.cpp -o myprog -I/usr/local/include -L/usr/local/lib -lexiv2
330330
```
331331

332332
[TOC](#TOC)
@@ -346,7 +346,7 @@ $ cat - > CMakeLists.txt <<EOF
346346
cmake_minimum_required(VERSION 3.11)
347347
project(exifprint VERSION 0.0.1 LANGUAGES CXX)
348348
349-
set(CMAKE_CXX_STANDARD 17)
349+
set(CMAKE_CXX_STANDARD 20)
350350
set(CMAKE_CXX_EXTENSIONS OFF)
351351
352352
find_package(exiv2 REQUIRED CONFIG NAMES exiv2) # search ${CMAKE_INSTALL_PREFIX}/lib/cmake/exiv2/
@@ -382,7 +382,7 @@ LDFLAGS := `pkg-config exiv2 --libs`
382382
If you are not using make, you can use pkg-config as follows:
383383

384384
```bash
385-
g++ -std=c++17 myprogram.cpp -o myprogram $(pkg-config exiv2 --libs --cflags)
385+
g++ -std=c++20 myprogram.cpp -o myprogram $(pkg-config exiv2 --libs --cflags)
386386
```
387387

388388
[TOC](#TOC)
@@ -502,19 +502,19 @@ To build the documentation, you must install the following products:
502502

503503
## Building Exiv2 Tag Webpages
504504

505-
Exiv2 provides many built-in metadata tags which are listed in the sub-pages of https://exiv2.org/metadata.html
506-
and https://pre-release.exiv2.org/metadata.html. Those tag webpages are generated using tag information
505+
Exiv2 provides many built-in metadata tags which are listed in the sub-pages of https://exiv2.org/metadata.html
506+
and https://pre-release.exiv2.org/metadata.html. Those tag webpages are generated using tag information
507507
extracted from the Exiv2 source code.
508508

509-
The tag webpage build files are in the `<exiv2dir>/doc/templates` directory. If changes are made to
510-
tag groups in the Exiv2 source code then the build files need to be updated. Any changes made
509+
The tag webpage build files are in the `<exiv2dir>/doc/templates` directory. If changes are made to
510+
tag groups in the Exiv2 source code then the build files need to be updated. Any changes made
511511
to individual tags in an existing tag group are automatically included.
512512

513-
Building the tag webpages requires building the Exiv2 sample programs and using scripts which have additional dependencies on
514-
[BASH](https://www.gnu.org/software/bash/), [make](https://manpages.org/make), [xsltproc](https://manpages.org/xsltproc)
513+
Building the tag webpages requires building the Exiv2 sample programs and using scripts which have additional dependencies on
514+
[BASH](https://www.gnu.org/software/bash/), [make](https://manpages.org/make), [xsltproc](https://manpages.org/xsltproc)
515515
and [Python3](https://www.python.org/).
516516

517-
To build the tag webpages, first [build Exiv2 from source](#TOC) with the `-DEXIV2_BUILD_SAMPLES=ON`
517+
To build the tag webpages, first [build Exiv2 from source](#TOC) with the `-DEXIV2_BUILD_SAMPLES=ON`
518518
option enabled. This is required as the [taglist](README-SAMPLES.md#taglist) sample program is used by one of the scripts.
519519

520520
Next, set the `EXIV2_BINDIR` environment variable (see [Exiv2 environment variables](#EnvironmentVariables)).
@@ -526,7 +526,7 @@ $ cd <exiv2dir>/doc/templates
526526
$ make
527527
```
528528

529-
After processing, the generated webpages are stored in the `<exiv2dir>/doc/templates` directory.
529+
After processing, the generated webpages are stored in the `<exiv2dir>/doc/templates` directory.
530530
When the Exiv2 websites are updated, the generated tag webpages are reformatted before use.
531531

532532
[TOC](#TOC)
@@ -858,7 +858,7 @@ You will find that 3 tests fail at the end of the test suite. It is safe to ign
858858
859859
## Static and Shared Libraries
860860
861-
You can build either static or shared libraries. Both can be linked with either static or shared run-time libraries. You specify the shared/static with the option `-BUILD_SHARED_LIBS=ON|OFF` You specify the run-time with the option `-DEXIV2_ENABLE_DYNAMIC_RUNTIME=ON|OFF`. The default for both options default is ON. So you build shared and use the shared libraries which are `.dll` on Windows (msvc, Cygwin and MinGW/msys), `.dylib` on macOS and `.so` on Linux and UNIX.
861+
You can build either static or shared libraries. Both can be linked with either static or shared run-time libraries. You specify the shared/static with the option `-BUILD_SHARED_LIBS=ON|OFF` You specify the run-time with the option `-DEXIV2_ENABLE_DYNAMIC_RUNTIME=ON|OFF`. The default for both options default is ON. So you build shared and use the shared libraries which are `.dll` on Windows (msvc, Cygwin and MinGW/msys), `.dylib` on macOS and `.so` on Linux and UNIX.
862862
863863
CMake creates your build artefacts in the directories `bin` and `lib`. The `bin` directory contains your executables and .DLLs. The `lib` directory contains your static libraries. When you install exiv2, the build artefacts are copied to your system's prefix directory which by default is `/usr/local/`. If you wish to test and use your build without installing, you will have to set you PATH appropriately. Linux/Unix users should also set `LD_LIBRARY_PATH` and macOS users should set `DYLD_LIBRARY_PATH`.
864864
@@ -1005,7 +1005,7 @@ The Variable EXIV2\_PORT or EXIV2\_HTTP can be set to None to skip http tests.
10051005
You can run tests directly from the build:
10061006
10071007
```bash
1008-
$ cmake -S . -B build -G "Unix Makefiles" -DEXIV2_BUILD_UNIT_TESTS=ON
1008+
$ cmake -S . -B build -G "Unix Makefiles" -DEXIV2_BUILD_UNIT_TESTS=ON
10091009
... lots of output and build summary ...
10101010
$ cmake --build build
10111011
... lots of output ...
@@ -1045,7 +1045,7 @@ $
10451045
> set PATH=c:\Python37;%PATH%
10461046
```
10471047
1048-
You can execute the test suite in a similar manner to that described for UNIX-like systems. You _**must**_ provide the `-C` config option to ctest for Visual Studio builds.
1048+
You can execute the test suite in a similar manner to that described for UNIX-like systems. You _**must**_ provide the `-C` config option to ctest for Visual Studio builds.
10491049
10501050
```cmd
10511051
> cd <exiv2dir>
@@ -1111,7 +1111,7 @@ You can run the bugfix tests from the build directory:
11111111
11121112
```bash
11131113
$ cd <exiv2dir>
1114-
$ ctest --test-dir build -R bugfix
1114+
$ ctest --test-dir build -R bugfix
11151115
```
11161116
11171117
If you wish to run in verbose mode:

cmake/compilerFlags.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
include(CheckCXXCompilerFlag)
33

44
if (NOT CMAKE_CXX_STANDARD)
5-
set(CMAKE_CXX_STANDARD 17)
5+
set(CMAKE_CXX_STANDARD 20)
66
endif()
77
set(CMAKE_CXX_STANDARD_REQUIRED ON)
88
if (CYGWIN) # Cygwin and MSYS

meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ project(
33
'cpp',
44
version: '1.0.0',
55
meson_version: '>=0.54.1',
6-
default_options: ['warning_level=0', 'cpp_std=c++17'],
6+
default_options: ['warning_level=0', 'cpp_std=c++20'],
77
)
88

99
cargs = ['-D_GNU_SOURCE']

0 commit comments

Comments
 (0)