Skip to content

Commit

Permalink
Disable "toolchain resolution" in Bazel 7
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tanzislam committed Aug 31, 2024
1 parent 54e3a74 commit c0a5cba
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions prepare_deps
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,12 @@ function build_gtest {
"BUILD.bazel\nWORKSPACE"
if [[ $BAZEL != "true" ]]
then
compiler_override="--incompatible_enable_cc_toolchain_resolution=false"
system_name=$(uname -s)
if [[ $system_name =~ ^MINGW ]]
then
compiler_override="--compiler=mingw-gcc"
elif [[ $system_name =~ ^MSYS_ ]]
then
compiler_override="--compiler=msys-gcc"
if [[ $system_name =~ ^MINGW ]]; then
compiler_override+=" --compiler=mingw-gcc"
elif [[ $system_name =~ ^MSYS_ ]]; then
compiler_override+=" --compiler=msys-gcc"
fi
compiler_override+=" --cxxopt=-std=c++14"
$BAZEL --batch build $compiler_override gtest gtest_main
Expand Down

0 comments on commit c0a5cba

Please sign in to comment.