Skip to content

Commit 83d36e2

Browse files
committed
move some CFLAGS to CI only
1 parent 110d05c commit 83d36e2

File tree

1 file changed

+16
-9
lines changed

1 file changed

+16
-9
lines changed

ext/mysql2/extconf.rb

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,7 @@ def asplode(lib)
9494

9595
# This is our wishlist. We use whichever flags work on the host.
9696
# -Wall and -Wextra are included by default.
97-
usable_flags = [
98-
'-fsanitize=address',
99-
'-fsanitize=cfi',
100-
'-fsanitize=integer',
101-
'-fsanitize=memory',
102-
'-fsanitize=thread',
103-
'-fsanitize=undefined',
104-
'-Werror',
97+
wishlist = [
10598
'-Weverything',
10699
'-Wno-bad-function-cast', # rb_thread_call_without_gvl returns void * that we cast to VALUE
107100
'-Wno-conditional-uninitialized', # false positive in client.c
@@ -117,7 +110,21 @@ def asplode(lib)
117110
'-Wno-switch-enum', # result.c -- enum_field_types (when not fully covered, e.g. mysql 5.6+)
118111
'-Wno-undef', # rubinius :(
119112
'-Wno-used-but-marked-unused', # rubby :(
120-
].select do |flag|
113+
]
114+
115+
if ENV['CI']
116+
wishlist += [
117+
'-Werror',
118+
'-fsanitize=address',
119+
'-fsanitize=cfi',
120+
'-fsanitize=integer',
121+
'-fsanitize=memory',
122+
'-fsanitize=thread',
123+
'-fsanitize=undefined',
124+
]
125+
end
126+
127+
usable_flags = wishlist.select do |flag|
121128
try_link('int main() {return 0;}', flag)
122129
end
123130

0 commit comments

Comments
 (0)