grpc.io icon indicating copy to clipboard operation
grpc.io copied to clipboard

Quick start: Abseil-C++ build on Catalina requires CMAKE_CXX_STANDARD flag

Open rfgunion opened this issue 3 years ago • 1 comments

On Mac OSX Catalina, I found the abseil build failed because it did not default to a C++11 or higher standard. I replaced the cmake command,

cmake -DCMAKE_INSTALL_PREFIX=$MY_INSTALL_DIR \
      -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE \
      ../..

with:

cmake -DCMAKE_INSTALL_PREFIX=$MY_INSTALL_DIR \
      -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE \
      -DCMAKE_CXX_STANDARD=17 \
      ../..

and all was well. I didn't try this with 11 because my projects all use 17, but it should work equally well.

rfgunion avatar Sep 12 '21 16:09 rfgunion

CC @veblush

sanjaypujare avatar Sep 15 '21 17:09 sanjaypujare