I am interested in using C++14 for compiling my entire C++ code base. How do I enable this gcc/clang option --std=c++14 globally in bazel 0.2.3/bazel 0.3.0?
Would appreciate if somebody can respond. Thanks
cheers
/karthik
/karthik
--
You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/0edf51b1-f0f8-4ce9-865c-0a7d0cdbcf00%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
/usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -B/usr/bin -B/usr/bin -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer '--std=c++14' '-std=c++0x' -MD -MF bazel-out/local-fastbuild/bin/test/util/_objs/traits/test/util/traits.pic.d '-frandom-seed=bazel-out/local-fastbuild/bin/test/util/_objs/traits/test/util/traits.pic.o' -fPIC -iquote . -iquote bazel-out/local-fastbuild/genfiles -iquote external/gtest -iquote bazel-out/local-fastbuild/genfiles/external/gtest -iquote external/bazel_tools -iquote bazel-out/local-fastbuild/genfiles/external/bazel_tools -isystem external/bazel_tools/tools/cpp/gcc3 -Iexternal/gtest/googletest/include/ -fno-canonical-system-headers -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -c test/util/traits.cpp -o bazel-out/local-fastbuild/bin/test/util/_objs/traits/test/util/traits.pic.o)
How can I tell Bazel NOT to put the --std=c++0x option?
--
You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/419ff3b4-6ba8-4dda-b386-66ad4ebfb60c%40googlegroups.com.
+Marcel
On Sun, Jul 2, 2017 at 1:25 AM, <harn...@gmail.com> wrote:
Same here: I added the option in tools/bazel.rc with no luck; upon building the compiler still complains about C++14-only constructs.
Debugging, it seems that Bazel issues this huge command, where the C++14 option is present together with another for C++0x (and presumably the latter is winning):
/usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -B/usr/bin -B/usr/bin -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer '--std=c++14' '-std=c++0x' -MD -MF bazel-out/local-fastbuild/bin/test/util/_objs/traits/test/util/traits.pic.d '-frandom-seed=bazel-out/local-fastbuild/bin/test/util/_objs/traits/test/util/traits.pic.o' -fPIC -iquote . -iquote bazel-out/local-fastbuild/genfiles -iquote external/gtest -iquote bazel-out/local-fastbuild/genfiles/external/gtest -iquote external/bazel_tools -iquote bazel-out/local-fastbuild/genfiles/external/bazel_tools -isystem external/bazel_tools/tools/cpp/gcc3 -Iexternal/gtest/googletest/include/ -fno-canonical-system-headers -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -c test/util/traits.cpp -o bazel-out/local-fastbuild/bin/test/util/_objs/traits/test/util/traits.pic.o)
How can I tell Bazel NOT to put the --std=c++0x option?
--
You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/419ff3b4-6ba8-4dda-b386-66ad4ebfb60c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/cb0f454e-e2a8-49fc-8de9-1a0b8e67f75c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/cb0f454e-e2a8-49fc-8de9-1a0b8e67f75c%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/cb0f454e-e2a8-49fc-8de9-1a0b8e67f75c%40googlegroups.com.
----Marcel Hlopko | Software Engineer | hlo...@google.com |Google Germany GmbH | Erika-Mann-Str. 33 | 80636 München | Germany | Geschäftsführer: Matthew Scott Sucherman, Paul Terence Manicle | Registergericht und -nummer: Hamburg, HRB 86891
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/cb0f454e-e2a8-49fc-8de9-1a0b8e67f75c%40googlegroups.com.
----Marcel Hlopko | Software Engineer | hlo...@google.com |Google Germany GmbH | Erika-Mann-Str. 33 | 80636 München | Germany | Geschäftsführer: Matthew Scott Sucherman, Paul Terence Manicle | Registergericht und -nummer: Hamburg, HRB 86891
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/cb0f454e-e2a8-49fc-8de9-1a0b8e67f75c%40googlegroups.com.
----Marcel Hlopko | Software Engineer | hlo...@google.com |Google Germany GmbH | Erika-Mann-Str. 33 | 80636 München | Germany | Geschäftsführer: Matthew Scott Sucherman, Paul Terence Manicle | Registergericht und -nummer: Hamburg, HRB 86891
----Marcel Hlopko | Software Engineer | hlo...@google.com |Google Germany GmbH | Erika-Mann-Str. 33 | 80636 München | Germany | Geschäftsführer: Matthew Scott Sucherman, Paul Terence Manicle | Registergericht und -nummer: Hamburg, HRB 86891
It seems that setting the environment variable BAZEL_CXXOPTS to e.g. -std=c++14 works (in that it replaces the other -std setting). This can also be done in the .bazelrc file via a line
build --action_env=BAZEL_CXXOPTS=-std=c++14