如何在 Bazel 构建命令期间传递 FLAG 如 -DVERBOSE?
How to pass a FLAG such as -DVERBOSE during a Bazel build command?
我想做一些事情,比如设置一个宏名称来激活我的部分代码......
g++ -DVERBOSE=1 main.cc
在 Bazel 构建命令期间:
bazel build //myproj:main
可能吗?
bazel build //myproj:main --cxxopt=-DVERBOSE=1
或者,在cc_*
目标中使用copts
属性。
https://docs.bazel.build/versions/master/user-manual.html#flag--cxxopt
相关文章:
- 如何在 Bazel 构建命令期间传递 FLAG 如 -DVERBOSE?
- 使用flag、return、exception、goto或break中止过程
- gRPC trace.cc 的方法 TraceFlagList::Add(TraceFlag* flag) 使其链接列表
- 我可以对"int 文件 = open(path, flag);"做点什么吗?
- CMake: Hide -WShadow global compile flag for child target
- 条件_variable,sutex和flag在一个结构中
- OpenCV 鼠标事件始终在鼠标滚动时接收事件 10 和 *flag* 0
- C++11 empty flag classes
- 它是如何工作的"checking bit flag"
- ::std::regex_replace with syntax flag icase on Windows(VS201
- CUDA 在运行时检查 nvcc "-arch"-flag
- cvLogPolar 导致 opencv 错误"Bad flag (parameter or structure field)"
- 在 c++ 中,使用 std::numeric_limits<double>::max() 作为特殊"flag"是否安全?
- Visual Studio C vs. C++ Flag Issue
- "save_and_cli(flag)"到底是如何运作的?
- 仅当设置了flag时打开文件(并稍后关闭它)
- 为什么 OpenCV 会为此代码发出"Bad flag in unknown function"?