nolan liou
nolan liou

Reputation: 115

Bazel build command line pass copt argument to just a specific cc_library/cc_binary?

I want to use a variable copt argument to build a specific target. so I use the --copt of bazel build command line.

However bazel will rebuild all dependencies of the target when the copt changed. these is not needed.

Is there some better way to deal with the situation?

Thanks a lot.

Upvotes: 1

Views: 1548

Answers (1)

Benjamin Peterson
Benjamin Peterson

Reputation: 20580

With --per_file_copt, you can finely control the compiler options for particular files from the command line.

Upvotes: 2

Related Questions