@@ -14,25 +14,25 @@ if (NOT DEFINED CODEQL_BAZEL_WORKSPACE)
14
14
endif ()
15
15
16
16
macro (bazel )
17
- execute_process (COMMAND ${BAZEL_BIN} ${ARGN}
17
+ execute_process (COMMAND ${BAZEL_BIN} ${BAZEL_STARTUP_OPTIONS} ${ ARGN}
18
18
COMMAND_ERROR_IS_FATAL ANY
19
19
OUTPUT_STRIP_TRAILING_WHITESPACE
20
20
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} )
21
21
endmacro ()
22
22
23
23
macro (bazel_even_if_failing )
24
- execute_process (COMMAND ${BAZEL_BIN} ${ARGN}
24
+ execute_process (COMMAND ${BAZEL_BIN} ${BAZEL_STARTUP_OPTIONS} ${ ARGN}
25
25
OUTPUT_STRIP_TRAILING_WHITESPACE
26
26
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} )
27
27
endmacro ()
28
28
29
29
bazel (info workspace OUTPUT_VARIABLE BAZEL_WORKSPACE )
30
-
31
30
bazel (info output_base OUTPUT_VARIABLE BAZEL_OUTPUT_BASE )
32
31
set (BAZEL_EXEC_ROOT ${BAZEL_OUTPUT_BASE} /execroot/_main )
32
+ set (BAZEL_BUILD_OPTIONS --nocheck_visibility --keep_going )
33
33
34
34
macro (include_generated BAZEL_TARGET )
35
- bazel (build ${BAZEL_TARGET} --nocheck_visibility )
35
+ bazel (build ${BAZEL_TARGET} ${BAZEL_BUILD_OPTIONS} )
36
36
string (REPLACE "@" "/external/" BAZEL_TARGET_PATH ${BAZEL_TARGET} )
37
37
string (REPLACE "//" "/" BAZEL_TARGET_PATH ${BAZEL_TARGET_PATH} )
38
38
string (REPLACE ":" "/" BAZEL_TARGET_PATH ${BAZEL_TARGET_PATH} )
@@ -42,7 +42,7 @@ endmacro()
42
42
macro (generate_and_include )
43
43
file (REMOVE "${BAZEL_WORKSPACE} /.bazel-cmake/BUILD.bazel" )
44
44
# use aquery to only get targets compatible with the current platform
45
- bazel_even_if_failing (aquery "kind(\" cc_test|cc_binary\" , ${ARGN} )" --nocheck_visibility --keep_going --output=jsonproto OUTPUT_VARIABLE BAZEL_AQUERY_RESULT )
45
+ bazel_even_if_failing (aquery "kind(\" cc_test|cc_binary\" , ${ARGN} )" ${BAZEL_BUILD_OPTIONS} --output=jsonproto OUTPUT_VARIABLE BAZEL_AQUERY_RESULT )
46
46
string (JSON BAZEL_JSON_TARGETS GET "${BAZEL_AQUERY_RESULT} " targets )
47
47
string (JSON LAST_IDX LENGTH "${BAZEL_JSON_TARGETS} " )
48
48
math (EXPR LAST_IDX "${LAST_IDX} - 1" )
0 commit comments