Skip to content

Commit

Permalink
Use line control in merged .c file
Browse files Browse the repository at this point in the history
  • Loading branch information
jhawthorn committed Dec 28, 2023
1 parent e577853 commit 3f5b48b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion contrib/ruby/ext/trilogy-ruby/extconf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@

# concatenate trilogy library sources to allow the compiler to optimise across
# source files

trilogy_src_dir = File.realpath("src", __dir__)
File.binwrite("trilogy.c",
Dir["#{__dir__}/src/**/*.c"].map { |src| File.binread(src) }.join)
Dir["#{trilogy_src_dir}/**/*.c"].map { |src|
%{#line 1 "#{src}"\n} + File.binread(src)
}.join)

$objs = %w[trilogy.o cast.o cext.o]
$CFLAGS << " -I #{__dir__}/inc -std=gnu99 -fvisibility=hidden"
Expand Down

0 comments on commit 3f5b48b

Please sign in to comment.