Skip to content

Commit 98abfd8

Browse files
stanhumudge
authored andcommitted
Work around x64-mingw-ucrt build failures in abseil-cpp
Previously the build would fail with this error message: ``` [ 37%] Building CXX object absl/synchronization/CMakeFiles/synchronization.dir/internal/create_thread_identity.cc.obj In file included from /tmp/d20230909-93-l6kcab/tmp/x86_64-w64-mingw32/ports/abseil/20230802.0/abseil-cpp-20230802.0/absl/synchronization/internal/create_thread_identity.cc:21: /tmp/d20230909-93-l6kcab/tmp/x86_64-w64-mingw32/ports/abseil/20230802.0/abseil-cpp-20230802.0/absl/synchronization/internal/waiter.h:44:2: error: #error ABSL_WAITER_MODE is undefined 44 | #error ABSL_WAITER_MODE is undefined | ^~~~~ /tmp/d20230909-93-l6kcab/tmp/x86_64-w64-mingw32/ports/abseil/20230802.0/abseil-cpp-20230802.0/absl/synchronization/internal/waiter.h:51:5: warning: "ABSL_WAITER_MODE" is not defined, evaluates to 0 [-Wundef] 51 | #if ABSL_WAITER_MODE == ABSL_WAITER_MODE_FUTEX | ^~~~~~~~~~~~~~~~ In file included from /tmp/d20230909-93-l6kcab/tmp/x86_64-w64-mingw32/ports/abseil/20230802.0/abseil-cpp-20230802.0/absl/synchronization/internal/create_thread_identity.cc:21: /tmp/d20230909-93-l6kcab/tmp/x86_64-w64-mingw32/ports/abseil/20230802.0/abseil-cpp-20230802.0/absl/synchronization/internal/waiter.h:52:16: error: 'FutexWaiter' does not name a type 52 | using Waiter = FutexWaiter; | ^~~~~~~~~~~ make[2]: *** [absl/synchronization/CMakeFiles/synchronization.dir/build.make:92: absl/synchronization/CMakeFiles/synchronization.dir/internal/create_thread_identity.cc.obj] Error 1 ``` As mentioned in abseil/abseil-cpp#1510 (comment), work around the issue by explicitly defining `-DABSL_FORCE_WAITER_MODE=4` (4 = `ABSL_WAITER_MODE_STDCPP`).
1 parent 945e0de commit 98abfd8

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

ext/re2/extconf.rb

+2
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,8 @@ def build_with_vendored_libraries
398398

399399
process_recipe(abseil_recipe) do |recipe|
400400
recipe.configure_options += ['-DABSL_PROPAGATE_CXX_STD=ON', '-DCMAKE_CXX_VISIBILITY_PRESET=hidden']
401+
# Workaround for https://github.com/abseil/abseil-cpp/issues/1510
402+
recipe.configure_options += ['-DCMAKE_CXX_FLAGS=-DABSL_FORCE_WAITER_MODE=4'] if windows?
401403
end
402404

403405
process_recipe(re2_recipe) do |recipe|

0 commit comments

Comments
 (0)