BinaryRyan opened a new issue, #2522:
URL: https://github.com/apache/brpc/issues/2522

   **Describe the bug (描述bug)**
   
   
在我编译成功protobuf之后、我尝试编译brpc,但是一直报告我的编译器不支持C++14,在我编译protobuf时并没有这个错误,我实在不知道这个201103L他是从哪里拿到的。
   
   ```cmake
   
   set(CMAKE_CXX_STANDARD 17)
   set(CMAKE_CXX_STANDARD_REQUIRED ON)
   set(CMAKE_CXX_COMPILER /usr/bin/g++)
   ......
   include(googletest)
   include(benchmark)
   include(leveldb)
   include(gflags)
   include(jsoncpp)
   include(abseil)
   include(protobuf)
   if(UNIX OR APPLE)
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -Wall -std=c++17")
   endif()
   
   message(STATUS "CMAKE_CXX_FLAGS:${CMAKE_CXX_FLAGS}")
   include(brpc)
   ````
   
   ```cmake
   set(FETCHCONTENT_BASE_DIR ${CMAKE_BINARY_DIR}/third-party)
   FetchContent_Declare(
     brpc
     URL ${BRPC_URL}
   )
   
   FetchContent_GetProperties(brpc)
   if(NOT brpc_POPULATED)
     FetchContent_Populate(
       brpc
     )
   endif()
   
   ExternalProject_Add(
     brpc_ext
     SOURCE_DIR         "${CMAKE_BINARY_DIR}/third-party/brpc-src"
     BINARY_DIR         "${CMAKE_BINARY_DIR}/third-party/brpc-build"
     CMAKE_ARGS         ${COMMON_FLAGS_CMAKE}
     # Wrap download, configure and build steps in a script to log output
     LOG_DOWNLOAD       ON
     LOG_CONFIGURE      ON
     LOG_BUILD          ON
     TEST_COMMAND       ""
   )
   
   ExternalProject_Get_Property(brpc_ext source_dir binary_dir)
   ```
   
   **To Reproduce (复现方法)**
   
   
   **Expected behavior (期望行为)**
   正常编译
   
   **Versions (各种版本)**
   OS: macos m1
   Compiler: clangd++
   brpc: 1.7
   protobuf: 24.4
   
   **Additional context/screenshots (更多上下文/截图)**
   
   <img width="883" alt="image" 
src="https://github.com/apache/brpc/assets/153162956/8d2f1ae2-585b-4873-8a31-c7b2b3b14216";>
   
   <img width="898" alt="image" 
src="https://github.com/apache/brpc/assets/153162956/17fe56cf-bf69-40a4-8da0-0be2f239cd4a";>
   
   <img width="311" alt="image" 
src="https://github.com/apache/brpc/assets/153162956/69785718-5804-43e1-b4f0-d04de48bbe1c";>
   
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org
For additional commands, e-mail: dev-h...@brpc.apache.org

Reply via email to