File tree Expand file tree Collapse file tree 4 files changed +17
-18
lines changed Expand file tree Collapse file tree 4 files changed +17
-18
lines changed Original file line number Diff line number Diff line change @@ -99,7 +99,7 @@ def initialize(gem_name)
99
99
#
100
100
# @return [Hash<String, String>]
101
101
def self . build_env_vars
102
- ldflags = generate_ldflags
102
+ ldflags = GoGem :: Util . generate_ldflags
103
103
cflags = generate_cflags
104
104
105
105
# FIXME: Workaround for Ubuntu (GitHub Actions)
@@ -132,21 +132,6 @@ def self.generate_goflags
132
132
end
133
133
private_class_method :generate_goflags
134
134
135
- # @return [String]
136
- def self . generate_ldflags
137
- ldflags = "-L#{ RbConfig ::CONFIG [ "libdir" ] } -l#{ RbConfig ::CONFIG [ "RUBY_SO_NAME" ] } "
138
-
139
- case `#{ RbConfig ::CONFIG [ "CC" ] } --version` # rubocop:disable Lint/LiteralAsCondition
140
- when /Free Software Foundation/
141
- ldflags << " -Wl,--unresolved-symbols=ignore-all"
142
- when /clang/
143
- ldflags << " -undefined dynamic_lookup"
144
- end
145
-
146
- ldflags
147
- end
148
- private_class_method :generate_ldflags
149
-
150
135
# @return [String]
151
136
def self . generate_cflags
152
137
[
Original file line number Diff line number Diff line change @@ -14,5 +14,19 @@ module Util
14
14
def self . ruby_minor_version_build_tag ( ruby_version = RUBY_VERSION )
15
15
"ruby_#{ ruby_version . to_f . to_s . gsub ( "." , "_" ) } "
16
16
end
17
+
18
+ # @return [String]
19
+ def self . generate_ldflags
20
+ ldflags = "-L#{ RbConfig ::CONFIG [ "libdir" ] } -l#{ RbConfig ::CONFIG [ "RUBY_SO_NAME" ] } "
21
+
22
+ case `#{ RbConfig ::CONFIG [ "CC" ] } --version` # rubocop:disable Lint/LiteralAsCondition
23
+ when /Free Software Foundation/
24
+ ldflags << " -Wl,--unresolved-symbols=ignore-all"
25
+ when /clang/
26
+ ldflags << " -undefined dynamic_lookup"
27
+ end
28
+
29
+ ldflags
30
+ end
17
31
end
18
32
end
Original file line number Diff line number Diff line change @@ -32,8 +32,6 @@ module GoGem
32
32
33
33
def self.generate_goflags : () -> String
34
34
35
- def self.generate_ldflags : () -> String
36
-
37
35
def self.generate_cflags : () -> String
38
36
39
37
private
Original file line number Diff line number Diff line change 1
1
module GoGem
2
2
module Util
3
3
def self.ruby_minor_version_build_tag : (?String ruby_version) -> String
4
+
5
+ def self.generate_ldflags : () -> String
4
6
end
5
7
end
You can’t perform that action at this time.
0 commit comments