From 9dc27ee9bcb0763fbeb4ae45f46181bbd25f199f Mon Sep 17 00:00:00 2001 From: tqcq <99722391+tqcq@users.noreply.github.com> Date: Sun, 3 Dec 2023 12:33:49 +0800 Subject: [PATCH] gs --- CMakeLists.txt | 4 ++-- cmake/ExternalAntlr4Cpp.cmake | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 325cfac..d356b7f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,7 @@ cmake_minimum_required(VERSION 3.10) project(crpc) +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) find_program(Java_JAVA_EXECUTABLE NAMES java) list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) @@ -15,8 +17,6 @@ antlr4cpp_process_grammar(proto ${CMAKE_CURRENT_SOURCE_DIR}/src/grammar/ProtoParser.g4 ) -set(CMAKE_CXX_STANDARD 17) - FILE(GLOB_RECURSE SRC_LIST ${PROJECT_SOURCE_DIR}/src/*.cpp) add_executable(crpc ${SRC_LIST} diff --git a/cmake/ExternalAntlr4Cpp.cmake b/cmake/ExternalAntlr4Cpp.cmake index 4689ae1..dff681f 100644 --- a/cmake/ExternalAntlr4Cpp.cmake +++ b/cmake/ExternalAntlr4Cpp.cmake @@ -119,7 +119,7 @@ else() -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} -DWITH_STATIC_CRT:BOOL=${ANTLR4_WITH_STATIC_CRT} -DDISABLE_WARNINGS:BOOL=ON - # -DCMAKE_CXX_STANDARD:STRING=17 # if desired, compile the runtime with a different C++ standard + -DCMAKE_CXX_STANDARD:STRING=17 # if desired, compile the runtime with a different C++ standard # -DCMAKE_CXX_STANDARD:STRING=${CMAKE_CXX_STANDARD} # alternatively, compile the runtime with the same C++ standard as the outer project INSTALL_COMMAND "" EXCLUDE_FROM_ALL 1)