CMAKE中指定c++版本

cmake_minimum_required(VERSION 3.20)
project(YourProjectName)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

添加你的源文件

add_executable(YourExecutable main.cpp)

你可能感兴趣的:(c++,开发语言)