I'm trying to compile a target with c++17 with bazel and visual studio 2019 on Windows 10.
I tried having --cxxopt='-std=c++17'
inside .bazelrc
in the same directory of my workspace, but this didn't work.
For instance, I got the error
C:\Users\marki\plasty>bazel build --verbose_failures labeling:semantic_seg
INFO: Analyzed target //labeling:semantic_seg (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
ERROR: C:/users/marki/plasty/labeling/BUILD:1:1: C++ compilation of rule '//labeling:semantic_seg' failed (Exit 2)
class template optional is only available with C++17 or later.
...
labeling/semantic_seg.cpp(183): error C2429: language feature 'structured bindings' requires compiler flag '/std:c++17'
Target //labeling:semantic_seg failed to build
INFO: Elapsed time: 1.184s, Critical Path: 0.84s
INFO: 0 processes.
FAILED: Build did NOT complete successfully
I also tried --cxxopt='/std:c++17'
with similar results.