Skip to content

Commit c0a5cba

Browse files
committed
Disable "toolchain resolution" in Bazel 7
Reference: bazelbuild/bazel#7260. This causes GoogleTest on Windows to be built with MSVC instead of MinGW GCC, causing link failures. Started breaking in Travis CI on 19-Dec-2023: https://app.travis-ci.com/github/tanzislam/cryptopals/jobs/615204806.
1 parent 54e3a74 commit c0a5cba

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

prepare_deps

+5-6
Original file line numberDiff line numberDiff line change
@@ -111,13 +111,12 @@ function build_gtest {
111111
"BUILD.bazel\nWORKSPACE"
112112
if [[ $BAZEL != "true" ]]
113113
then
114+
compiler_override="--incompatible_enable_cc_toolchain_resolution=false"
114115
system_name=$(uname -s)
115-
if [[ $system_name =~ ^MINGW ]]
116-
then
117-
compiler_override="--compiler=mingw-gcc"
118-
elif [[ $system_name =~ ^MSYS_ ]]
119-
then
120-
compiler_override="--compiler=msys-gcc"
116+
if [[ $system_name =~ ^MINGW ]]; then
117+
compiler_override+=" --compiler=mingw-gcc"
118+
elif [[ $system_name =~ ^MSYS_ ]]; then
119+
compiler_override+=" --compiler=msys-gcc"
121120
fi
122121
compiler_override+=" --cxxopt=-std=c++14"
123122
$BAZEL --batch build $compiler_override gtest gtest_main

0 commit comments

Comments
 (0)