oxen-io / oxen-mq

Communications layer used for both the Oxen storage server and oxend
https://oxen.io
BSD 3-Clause "New" or "Revised" License
19 stars 36 forks source link

cmake: add check that compiler supports C++17 #33

Closed buccella closed 3 years ago

majestrate commented 3 years ago

how does this differ from

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

?

buccella commented 3 years ago

Honestly, I'm not sure if it is different at all.

Backstory: my compile failed due to std::string_view being unavailable. I supposed that there was a missing CMake check. So I went looking to see which standard string_view was included in, and added a check (this PR). Turns out that problem wasn't that a check was missing, but that my ye olde version of gcc only partly implements the C++17 standard. So it passes the CMake check, but fails the compile.

I upgraded; it's fine now. I don't think this PR will help anyone in the future.