Cmake generator: Remove space in argument.

This space breaks when upgrading bazelisk on Windows.
Somehow, a space inside the argument messes up some argument-parsin
somewhere. Porbably due to Windows argument parsing
being not well-defined in how it splits a string into argv.
Removing the space works around the problem.

If the space is included, cmake suddenly can't find the bazelisk
binary anymore, despite happily executing `info output_base` earlier.
This commit is contained in:
Cornelius Riemenschneider
2024-06-02 23:56:31 +02:00
parent 58ce3e805e
commit cff78cca5e

View File

@@ -42,7 +42,7 @@ endmacro()
macro(generate_and_include)
file(REMOVE "${BAZEL_WORKSPACE}/.bazel-cmake/BUILD.bazel")
# use aquery to only get targets compatible with the current platform
bazel_even_if_failing(aquery "kind(\"cc_test|cc_binary\", ${ARGN})" ${BAZEL_BUILD_OPTIONS} --output=jsonproto OUTPUT_VARIABLE BAZEL_AQUERY_RESULT)
bazel_even_if_failing(aquery "kind(\"cc_test|cc_binary\",${ARGN})" ${BAZEL_BUILD_OPTIONS} --output=jsonproto OUTPUT_VARIABLE BAZEL_AQUERY_RESULT)
string(JSON BAZEL_JSON_TARGETS GET "${BAZEL_AQUERY_RESULT}" targets)
string(JSON LAST_IDX LENGTH "${BAZEL_JSON_TARGETS}")
math(EXPR LAST_IDX "${LAST_IDX} - 1")