[build] Use platform-specific -std=c++14 compile flags (#32459)

With the `--copt="-std=c++14"` setting in the bazel.rc file as it is
today, MSVC builds have complained for every cc file:

```
cl : Command line warning D9002 : ignoring unknown option '-std=c++14'
```

This adds thousands of lines of noise to Windows builds, and hides
useful warnings. Using the `/std:c++14` flag on MSVC (and clang-cl) gets
us the desired result.
pull/32448/head^2
AJ Heller 2 years ago committed by GitHub
parent c558adc963
commit 3a0632136d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 18
      tools/bazel.rc

@ -1,10 +1,24 @@
# bazelrc file
# for platform-appropriate cxxopts
common --enable_platform_specific_config
build:windows --cxxopt='/std:c++14'
build:windows --host_cxxopt='/std:c++14'
build:linux --cxxopt='-std=c++14'
build:linux --host_cxxopt='-std=c++14'
build:macos --cxxopt='-std=c++14'
build:macos --host_cxxopt='-std=c++14'
build:freebsd --cxxopt='-std=c++14'
build:freebsd --host_cxxopt='-std=c++14'
# Don't trigger --config=<host platform> when cross-compiling.
build:android --noenable_platform_specific_config
build:ios --noenable_platform_specific_config
build --client_env=CC=clang
build --copt=-DGRPC_BAZEL_BUILD
build --cxxopt='-std=c++14'
build --host_copt=-DGRPC_BAZEL_BUILD
build --host_cxxopt='-std=c++14'
build --action_env=GRPC_BAZEL_RUNTIME=1
build --define=use_fast_cpp_protos=true

Loading…
Cancel
Save