I am trying to build an external project that uses Bazel as its build system from CMake with Ninja. I am doing this by using ExternalProject_Add
ExternalProject_Add(bazel_proj
SOURCE_DIR "${bazel_proj_DIR}"
CONFIGURE_COMMAND :
CONFIGURE_HANDLED_BY_BUILD ON
BUILD_COMMAND bazel build //:install
INSTALL_COMMAND bazel run //:install
BUILD_IN_SOURCE ON
BUILD_ALWAYS ON
USES_TERMINAL_BUILD ON
USES_TERMINAL_INSTALL ON
LOG_BUILD ON
LOG_INSTALL ON
LOG_OUTPUT_ON_FAILURE ON
LOG_MERGED_STDOUTERR ON
INACTIVITY_TIMEOUT 10
)
I tried to add --worker_quit_after_build
to the build command but it did not help. Bazel uses the linux-sandbox spawn strategy by default.
The only way to work around this is to stop the build with CTRL+C and start over so it goes to the install step the next time!
I also could not make CMake print the progress report of Bazel to the terminal. That might be related.