Skip to content

Commit

Permalink
Improve extconf.rb
Browse files Browse the repository at this point in the history
  • Loading branch information
seanchas116 committed May 19, 2015
1 parent c46d4c8 commit 36aa210
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions ext/qml/extconf.rb
Expand Up @@ -6,13 +6,18 @@

qmake = with_config('qmake') || find_executable('qmake')
debug_enabled = enable_config('debug')
clean_enabled = enable_config('clean')
qmake_opts = debug_enabled ? 'CONFIG+=debug' : ''

# build libqmlbind

qmlbind_dir = Pathname.pwd + 'lib/libqmlbind/qmlbind'

Dir.chdir(qmlbind_dir) do
system "#{qmake} && make" or fail "Failed to make libqmlbind"
puts " >>> building libqmlbind..."
system "#{qmake} #{qmake_opts}"
system "make clean" if clean_enabled
system "make -j4" or abort "ERROR: Failed to build libqmlbind"
end

case
Expand All @@ -28,12 +33,14 @@
# build plugin

Dir.chdir "rubyqml-plugin" do
qmake_opts = debug_enabled ? 'CONFIG+=debug' : ''
system "#{qmake} #{qmake_opts}" or fail "failed to configurate plugin"
system "make clean" if enable_config('clean-plugin', false)
system "make" or fail "failed to build plugin"
puts " >>> building rubyqml-plugin..."
system "#{qmake} #{qmake_opts}"
system "make clean" if clean_enabled
system "make -j4" or abort "ERROR: Failed to build plugin"
end

puts " >>> configuring..."

# create makefile

$LDFLAGS << " -L#{qmlbind_dir} -lqmlbind"
Expand Down

0 comments on commit 36aa210

Please sign in to comment.