Skip to content

Commit 8c66e08

Browse files
committed
fix: Fix compilation on macOS with Xcode 13
Xcode 13* introduces a new warning named compound-token-split-by-macro. One of the ruby headers triggers this warning. We build our extension with -Werror in CFLAGS, resulting in the issue described here: https://bugs.ruby-lang.org/issues/17865 . This doesn't appear to be a bug in the ruby header, so it seems safe to ignore it until it's fixed. This change keeps -Werror in CFLAGS, and just disables compound-token-split-by-macro. * The issue indicates this behavior was actually introduced in clang 12, which was probably part of Xcode 12.
1 parent f0bb5ca commit 8c66e08

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

ext/appmap/extconf.rb

+11
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
require "mkmf"
22

3+
34
$CFLAGS='-Werror'
5+
6+
# Per https://bugs.ruby-lang.org/issues/17865,
7+
# compound-token-split-by-macro was added in clang 12 and broke
8+
# compilation with some of the ruby headers. If the current compiler
9+
# supports the new warning, turn it off.
10+
new_warning = '-Wno-error=compound-token-split-by-macro'
11+
if try_cflags(new_warning)
12+
$CFLAGS += ' ' + new_warning
13+
end
14+
415
extension_name = "appmap"
516
dir_config(extension_name)
617
create_makefile(File.join(extension_name, extension_name))

0 commit comments

Comments
 (0)