Skip to content

Commit 862513b

Browse files
committed
WIP
1 parent bca7651 commit 862513b

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

lib/easy_compile/compilation_tasks.rb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,17 @@ def disable_shared
113113

114114
File.write(task.name, makefile_content)
115115
end
116+
117+
makefile_content.match(/^ldflags\W+=(.*)/) do |match|
118+
ldflags = match[1].split(" ")
119+
next if ldflags.include?("-s")
120+
121+
ldflags << "-s"
122+
123+
makefile_content.gsub!(/^(ldflags\W+=)(.*)/, "\\1#{ldflags.join(' ')}")
124+
125+
File.write(task.name, makefile_content)
126+
end
116127
end
117128
end
118129
end

test/fixtures/dummy_gem/ext/hello_world/extconf.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,4 @@
22

33
require "mkmf"
44

5-
$LDFLAGS << " -s -pipe" if RUBY_PLATFORM !~ /darwin/
6-
75
create_makefile("hello_world")

0 commit comments

Comments
 (0)