File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -330,3 +330,20 @@ module PG
330
330
create_header ( )
331
331
create_makefile ( "pg_ext" )
332
332
333
+ if gem_platform
334
+ # exercise the strip command on native binary gems
335
+ # This approach borrowed from
336
+ # https://github.com/rake-compiler/rake-compiler-dock/blob/38066d479050f4fdb3956469255b35a05e5949ef/test/rcd_test/ext/mri/extconf.rb#L97C1-L110C42
337
+ strip_tool = RbConfig ::CONFIG [ 'STRIP' ]
338
+ strip_tool += ' -x' if RUBY_PLATFORM =~ /darwin/
339
+ File . open ( 'Makefile.new' , 'w' ) do |o |
340
+ o . puts 'hijack: all strip'
341
+ o . puts
342
+ o . write ( File . read ( 'Makefile' ) )
343
+ o . puts
344
+ o . puts 'strip: $(DLLIB)'
345
+ o . puts "\t $(ECHO) Stripping $(DLLIB)"
346
+ o . puts "\t $(Q) #{ strip_tool } $(DLLIB)"
347
+ end
348
+ File . rename ( 'Makefile.new' , 'Makefile' )
349
+ end
You can’t perform that action at this time.
0 commit comments