Skip to content

Commit

Permalink
build: build c extension only on MRI platform, and make a dummy Makef…
Browse files Browse the repository at this point in the history
…ile for other platforms

close #19
  • Loading branch information
tonytonyjan committed Jun 6, 2018
1 parent 4b05c43 commit 7e66cbf
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions ext/jaro_winkler/extconf.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
require 'mkmf'
$CFLAGS << ' -std=c99 '
create_makefile('jaro_winkler/jaro_winkler_ext')
# frozen_string_literal: true

if RUBY_ENGINE == 'ruby'
require 'mkmf'
$CFLAGS << ' -std=c99 '
create_makefile('jaro_winkler/jaro_winkler_ext')
else
open('Makefile', 'wb') do |file|
file.write <<-MAKEFILE
.PHONY: install
install:
\techo "Cannot compile C Extension, fall back to pure Ruby version."
clean:
MAKEFILE
end
end

0 comments on commit 7e66cbf

Please sign in to comment.