google / s2geometry

Computational geometry and spatial indexing on the sphere
http://s2geometry.io/
Apache License 2.0
2.29k stars 302 forks source link

-DCMAKE_CXX_STANDARD=17 doesn't work #270

Closed jievince closed 2 years ago

jievince commented 2 years ago

The cache of build is cleared, and I specify -DCMAKE_CXX_STANDARD=17, but s2 still use c++11 to compile. But if I change the line set(CMAKE_CXX_STANDARD 11) to set(CMAKE_CXX_STANDARD 17) in CmakeLists.txt, it works.

jievince commented 2 years ago

The cache of build is cleared, and I specify -DCMAKE_CXX_STANDARD=17, but s2 still use c++11 to compile. But if I change the line set(CMAKE_CXX_STANDARD 11) to set(CMAKE_CXX_STANDARD 17) in CmakeLists.txt, it works.

The cmake flag will make affect when changing set(CMAKE_CXX_STANDARD 11) to option(CMAKE_CXX_STANDARD 11)

jmr commented 2 years ago

Could you open a PR to fix it?