From e5428c44a1aee1da94334d1f02708b5bc1cdc402 Mon Sep 17 00:00:00 2001 From: Akinori Musha Date: Sat, 11 Nov 2023 17:11:36 +0900 Subject: [PATCH] Fix build on mswin; /std:c++20 is required --- ext/unf_ext/extconf.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ext/unf_ext/extconf.rb b/ext/unf_ext/extconf.rb index d506cc3..952f681 100644 --- a/ext/unf_ext/extconf.rb +++ b/ext/unf_ext/extconf.rb @@ -6,6 +6,11 @@ have_library('stdc++') case RbConfig::CONFIG['host_os'] + when /mswin/ + # Avoid `error C7555: use of designated initializers requires at least '/std:c++20'` + $CFLAGS << ' ' << '/std=c++20' + $CPPFLAGS << ' ' << '/std=c++20' + $CXXFLAGS << ' ' << '/std=c++20' when /solaris(!?2.11)/ # Do a little trickery here to enable C++ standard on Solaris 11 if found. # This also forces 64bit compilation mode.