<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p><br>
    </p>
    <div class="moz-cite-prefix">Le 06/06/2024 à 20:21, Greg Troxel a
      écrit :<br>
    </div>
    <blockquote type="cite" cite="mid:rmih6e6vsnq.fsf@s1.lexort.com">
      <pre class="moz-quote-pre" wrap="">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</pre>
    </blockquote>
    set(CMAKE_CXX_STANDARD 17) at<br>
<a class="moz-txt-link-freetext" href="https://github.com/OSGeo/gdal/blob/399a0f55d20755120fa49dec36054d2fa8531fbc/CMakeLists.txt#L41">https://github.com/OSGeo/gdal/blob/399a0f55d20755120fa49dec36054d2fa8531fbc/CMakeLists.txt#L41</a><br>
    <blockquote type="cite" cite="mid:rmih6e6vsnq.fsf@s1.lexort.com">
      <pre class="moz-quote-pre" wrap="">
  - fail the build if that does not work with a message that makes it
    clear that the compiler doesn't work --std=c++17</pre>
    </blockquote>
    <p>cf set(CMAKE_CXX_STANDARD_REQUIRED ON) on following line<br>
    </p>
    <p>and
<a class="moz-txt-link-freetext" href="https://cmake.org/cmake/help/latest/prop_tgt/CXX_STANDARD_REQUIRED.html#prop_tgt:CXX_STANDARD_REQUIRED">https://cmake.org/cmake/help/latest/prop_tgt/CXX_STANDARD_REQUIRED.html#prop_tgt:CXX_STANDARD_REQUIRED</a><br>
    </p>
    <blockquote type="cite" cite="mid:rmih6e6vsnq.fsf@s1.lexort.com">
      <pre class="moz-quote-pre" wrap="">
  - 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</pre>
    </blockquote>
    <p><a class="moz-txt-link-freetext" href="https://cmake.org/cmake/help/latest/prop_tgt/CXX_STANDARD.html#prop_tgt:CXX_STANDARD">https://cmake.org/cmake/help/latest/prop_tgt/CXX_STANDARD.html#prop_tgt:CXX_STANDARD</a>:</p>
    <p>" For some compilers, this results in adding a
      flag such as <code class="docutils literal notranslate"><span
          class="pre">-std=gnu++11</span></code> to the compile line"</p>
    So all in all that should do the right thing.<br>
    <p>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<br>
    </p>
    --
    <pre class="moz-signature" cols="72"><a class="moz-txt-link-freetext" href="http://www.spatialys.com">http://www.spatialys.com</a>
My software is free, but my time generally not.</pre>
  </body>
</html>