1

I need to extract the compiler flags and linker flags for a certain application that is built by Bazel.

Is there a specific command to do so?

Vertexwahn
  • 7,709
  • 6
  • 64
  • 90
Ma.Ha
  • 11
  • 1

1 Answers1

1
bazel clean # force bazel to rebuild everything  
bazel build -s //...

There are more advanced approaches, e.g.:

You can also use system tools such as strace to figure how what tools are called by Bazel and which command line parameters are involved.

Vertexwahn
  • 7,709
  • 6
  • 64
  • 90
  • Thank you for your answer, bazel build -s prints the copts and linkopts on the cmd. But mu usecase to to print them in a file. I tried several trials, however I didn’t get them. – Ma.Ha Jan 05 '23 at 18:45