[gdal-dev] doc bugs about prereqs, surfaced by updating pkgsrc for 3.9

Even Rouault even.rouault at spatialys.com
Thu Jun 6 11:30:25 PDT 2024


Le 06/06/2024 à 20:21, Greg Troxel a écrit :
> also, I am far from a cmake expert, but I looked in the CMakeFiles  and
> cannot find where they
>
>    - try to run the compiler with --std=c++17
set(CMAKE_CXX_STANDARD 17) at
https://github.com/OSGeo/gdal/blob/399a0f55d20755120fa49dec36054d2fa8531fbc/CMakeLists.txt#L41
>    - fail the build if that does not work with a message that makes it
>      clear that the compiler doesn't work --std=c++17

cf set(CMAKE_CXX_STANDARD_REQUIRED ON) on following line

and 
https://cmake.org/cmake/help/latest/prop_tgt/CXX_STANDARD_REQUIRED.html#prop_tgt:CXX_STANDARD_REQUIRED

>    - if it works, add --std=c++17 to the compiler invocations, because
>      requiring a c++17 compiler is fine, but one can't assume that it
>      uses it by default

https://cmake.org/cmake/help/latest/prop_tgt/CXX_STANDARD.html#prop_tgt:CXX_STANDARD:

" For some compilers, this results in adding a flag such as 
|-std=gnu++11| to the compile line"

So all in all that should do the right thing.

No idea if you need gcc 7 or 8. I don't think we use super advanced 
C++17 features, so gcc 7 might be fine, but only experimentation would 
confirm that. I believe the minimum we test on our CI is gcc 9.4 that 
ships with Ubuntu 20.04

-- 

http://www.spatialys.com
My software is free, but my time generally not.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20240606/e26d5f26/attachment.htm>


More information about the gdal-dev mailing list