···5757 "-DgRPC_ABSL_PROVIDER=package"
5858 "-DBUILD_SHARED_LIBS=ON"
5959 "-DCMAKE_SKIP_BUILD_RPATH=OFF"
6060- "-DCMAKE_CXX_STANDARD=17"
6060+ # Needs to be compiled with -std=c++11 for clang < 11. Interestingly this is
6161+ # only an issue with the useLLVM stdenv, not the darwin stdenv…
6262+ # https://github.com/grpc/grpc/issues/26473#issuecomment-860885484
6363+ (if (stdenv.hostPlatform.useLLVM or false) && lib.versionOlder stdenv.cc.cc.version "11.0"
6464+ then "-DCMAKE_CXX_STANDARD=11"
6565+ else "-DCMAKE_CXX_STANDARD=17")
6166 ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
6267 "-D_gRPC_PROTOBUF_PROTOC_EXECUTABLE=${buildPackages.protobuf}/bin/protoc"
6368 ];
···6873 rm -vf BUILD
6974 '';
70757171- preBuild = ''
7676+ # When natively compiling, grpc_cpp_plugin is executed from the build directory,
7777+ # needing to load dynamic libraries from the build directory, so we set
7878+ # LD_LIBRARY_PATH to enable this. When cross compiling we need to avoid this,
7979+ # since it can cause the grpc_cpp_plugin executable from buildPackages to
8080+ # crash if build and host architecture are compatible (e. g. pkgsLLVM).
8181+ preBuild = lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) ''
7282 export LD_LIBRARY_PATH=$(pwd)''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH
7383 '';
7484