lib/autobuild/packages/cmake.rb in autobuild-1.3.3 vs lib/autobuild/packages/cmake.rb in autobuild-1.4.0
- old
+ new
@@ -38,11 +38,11 @@
# Declare that the given target can be used to generate documentation
def with_doc(target = 'doc')
doc_task do
Dir.chdir(builddir) do
Autobuild.progress "generating documentation for #{name}"
- Subprocess.run(name, 'doc', Autobuild.tool(:make), target)
+ Subprocess.run(name, 'doc', Autobuild.tool(:make), "-j#{parallel_build_level}", target)
yield if block_given?
end
end
end
@@ -132,23 +132,27 @@
end
# Do the build in builddir
def build
Dir.chdir(builddir) do
- Autobuild.progress "building #{name}"
+ Autobuild.progress_with_value "building #{name}"
if always_reconfigure || !File.file?('Makefile')
Subprocess.run(name, 'build', Autobuild.tool(:cmake), '.')
end
- Subprocess.run(name, 'build', Autobuild.tool(:make))
+ Subprocess.run(name, 'build', Autobuild.tool(:make), "-j#{parallel_build_level}") do |line|
+ if line =~ /\[\s+(\d+)%\]/
+ Autobuild.progress_value Integer($1)
+ end
+ end
end
Autobuild.touch_stamp(buildstamp)
end
# Install the result in prefix
def install
Dir.chdir(builddir) do
Autobuild.progress "installing #{name}"
- Subprocess.run(name, 'install', Autobuild.tool(:make), 'install')
+ Subprocess.run(name, 'build', Autobuild.tool(:make), "-j#{parallel_build_level}", 'install')
Autobuild.update_environment prefix
end
super
end
end