0

I would like to do something like setting a macro name that activates portions of my code....

g++ -DVERBOSE=1 main.cc

during the Bazel build command:

bazel build //myproj:main

Is it possible?

1 Answer 1

1

bazel build //myproj:main --cxxopt=-DVERBOSE=1

Or, use the copts attribute in cc_* targets.

https://docs.bazel.build/versions/master/user-manual.html#flag--cxxopt

Sign up to request clarification or add additional context in comments.

1 Comment

Can you elaborate on how to use copts outside a BUILD file? The docs dont hint it is possible.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.