@@ -102,19 +102,6 @@ def self.build_env_vars
102
102
ldflags = GoGem ::Util . generate_ldflags
103
103
cflags = generate_cflags
104
104
105
- # FIXME: Workaround for Ubuntu (GitHub Actions)
106
- if RUBY_PLATFORM =~ /linux/i
107
- cflags . gsub! ( "-Wno-self-assign" , "" )
108
- cflags . gsub! ( "-Wno-parentheses-equality" , "" )
109
- cflags . gsub! ( "-Wno-constant-logical-operand" , "" )
110
- cflags . gsub! ( "-Wsuggest-attribute=format" , "" )
111
- cflags . gsub! ( "-Wold-style-definition" , "" )
112
- cflags . gsub! ( "-Wsuggest-attribute=noreturn" , "" )
113
- end
114
-
115
- # FIXME: Workaround for Alpine
116
- cflags . gsub! ( "-Wpointer-arith" , "" ) if RUBY_PLATFORM =~ /linux-musl/i
117
-
118
105
ld_library_path = RbConfig ::CONFIG [ "libdir" ] . to_s
119
106
120
107
{
@@ -133,11 +120,27 @@ def self.generate_goflags
133
120
134
121
# @return [String]
135
122
def self . generate_cflags
136
- [
137
- RbConfig ::CONFIG [ "CFLAGS" ] ,
138
- "-I#{ RbConfig ::CONFIG [ "rubyarchhdrdir" ] } " ,
139
- "-I#{ RbConfig ::CONFIG [ "rubyhdrdir" ] } " ,
140
- ] . join ( " " )
123
+ cflags =
124
+ [
125
+ RbConfig ::CONFIG [ "CFLAGS" ] ,
126
+ "-I#{ RbConfig ::CONFIG [ "rubyarchhdrdir" ] } " ,
127
+ "-I#{ RbConfig ::CONFIG [ "rubyhdrdir" ] } " ,
128
+ ] . join ( " " )
129
+
130
+ # FIXME: Workaround for Ubuntu (GitHub Actions)
131
+ if RUBY_PLATFORM =~ /linux/i
132
+ cflags . gsub! ( "-Wno-self-assign" , "" )
133
+ cflags . gsub! ( "-Wno-parentheses-equality" , "" )
134
+ cflags . gsub! ( "-Wno-constant-logical-operand" , "" )
135
+ cflags . gsub! ( "-Wsuggest-attribute=format" , "" )
136
+ cflags . gsub! ( "-Wold-style-definition" , "" )
137
+ cflags . gsub! ( "-Wsuggest-attribute=noreturn" , "" )
138
+ end
139
+
140
+ # FIXME: Workaround for Alpine
141
+ cflags . gsub! ( "-Wpointer-arith" , "" ) if RUBY_PLATFORM =~ /linux-musl/i
142
+
143
+ cflags
141
144
end
142
145
private_class_method :generate_cflags
143
146
0 commit comments