Does Bazel have the same problems as CMake with file globbing?

I am starting a new project and must choose a build system. I don’t like manually adding every C ++ source file to my build rules, because this is what should be automated by 2016, and it does the extra work of reorganizing (rename the class in the header and source file, as well as the build system file ...).

I started using CMake with a recursive file extension when I came across this message: Specify source files globally using GLOB?

This suggests that globbing is evil because CMake uses two phases to build (cmake and make), and in normal use the user only restarts the second phase (make).

At first glance, Bazel also allows file substitution. Is it evil to use with Basel? Does findthe code base perform such a scaling problem that usually requires building systems?

+4
source share
2 answers

Bazel has no issues mentioned in this post, i.e.:

(We do not recommend using GLOB to collect a list of source files from your source tree. If the CMakeLists.txt file does not change when the source is added or deleted, then the generated build system cannot know when to ask CMake to restore.)

Bazel , - , . Globing Bazel.

, globbing, globs.

, , bazel:

bazel query '//path/to/your:target' --output=build
# /Users/kchodorow/gitroot/path/to/your/BUILD:7:1
java_library(
    name = "target",
    srcs = ["//path/to/your:A.java", "//path/to/your:B.java"],
)

"" , , Bazel .

+6

glob Bazel, , --watchfs, , , .

+3

All Articles