From 3273c10249411503e5972eaaf57267cb9590e46b Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Tue, 17 Sep 2024 09:52:44 -0700 Subject: [PATCH] Add space to play nicely with --with-cppflags parameters Attempting to build charlock_holmes with `--with-cppflags` will fail unless you append a space at the end. For example, to build with XCode 16.0 and macOS SDK 15.0, for some reason I had to manually add the C++ include path with a trailing space: ``` gem install charlock_holmes -- --enable-static --with-cppflags='-I/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1 ' ``` --- ext/charlock_holmes/extconf.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/charlock_holmes/extconf.rb b/ext/charlock_holmes/extconf.rb index 903c297..6b92106 100644 --- a/ext/charlock_holmes/extconf.rb +++ b/ext/charlock_holmes/extconf.rb @@ -56,7 +56,7 @@ # Pass -x c++ to force gcc to compile the test program # as C++ (as it will end in .c by default). -compile_options = +"-x c++" +compile_options = +" -x c++" icu_requires_version_flag = checking_for("icu that requires explicit C++ version flag") do !try_compile(minimal_program, compile_options)