From ddba76d1f27f383bfc05c5ecea03a8ebea2f87d8 Mon Sep 17 00:00:00 2001 From: Mihai Maruseac Date: Sat, 8 Aug 2020 18:02:41 -0700 Subject: [PATCH 1/2] C++17 build without linking libc++ Based on #23561 and #41710, trying to see if this would enable building on C++17 without also linking in `libc++` (which is a Clang lib, does not come from a default GCC install) --- .bazelrc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.bazelrc b/.bazelrc index ddeb2515d70..c15ce04fdfb 100644 --- a/.bazelrc +++ b/.bazelrc @@ -278,6 +278,8 @@ build:dynamic_kernels --copt=-DAUTOLOAD_DYNAMIC_KERNELS build:c++17 --cxxopt=-std=c++1z build:c++17 --cxxopt=-stdlib=libc++ build:c++1z --config=c++17 +build:c++17_gcc --cxxopt=-std=c++1z +build:c++1z_gcc --config=c++17_gcc # Enable using platform specific build settings, except when cross-compiling for # mobile platforms. From 9f62efeba92a72d6696fba46b1a55aa983f8338b Mon Sep 17 00:00:00 2001 From: Mihai Maruseac Date: Sat, 8 Aug 2020 18:06:25 -0700 Subject: [PATCH 2/2] Add documentation of the new options --- .bazelrc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.bazelrc b/.bazelrc index c15ce04fdfb..1b9f5e87c6b 100644 --- a/.bazelrc +++ b/.bazelrc @@ -18,8 +18,10 @@ # # Compiler options: # cuda_clang: Use clang when building CUDA code. -# c++17: Build with C++17 options -# c++1z: Build with C++17 options +# c++17: Build with C++17 options (links with libc++) +# c++1z: Build with C++17 options (links with libc++) +# c++17_gcc: Build with C++17 options (links with stdlibc++) +# c++1z_gcc: Build with C++17 options (links with stdlibc++) # avx_linux: Build with avx instruction set on linux. # avx2_linux: Build with avx2 instruction set on linux. # native_arch_linux: Build with instruction sets available to the host machine on linux