How to set c++ standard to c++17

44 views
Skip to first unread message

Alan Man Lok Ng

unread,
Jul 29, 2020, 12:26:10 AM7/29/20
to ngrest
Hello, I want to use the filesystem library in c++17. Thank you

loe...@gmail.com

unread,
Jul 29, 2020, 2:45:47 AM7/29/20
to ngrest
I believe it's sufficient to add something like this to the top of CMakeLists.txt :

include(CheckCXXCompilerFlag)

check_cxx_compiler_flag(-std=gnu++17 HAS_CXX17)
if (HAS_CXX17)
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++17")
endif()
Reply all
Reply to author
Forward
0 new messages