Rakefile: fix Qt dependencies to .ui for .moc

This commit is contained in:
Moritz Bunkus 2018-01-01 12:17:44 +01:00
parent 740838f793
commit 26f8fec50c

View File

@ -97,9 +97,10 @@ class Target
qobject_h_files = h_files.select { |h| content[h].any? { |line| /\bQ_OBJECT\b/.match line } }
form_include_re = %r{^\s* \# \s* include \s+ \" (#{subdir}/forms/[^\"]+) }x
dep_builder = lambda do |files|
extra_dependencies = {}
(cpp_files + h_files).each do |file_name|
files.each do |file_name|
content[file_name].each do |line|
next unless form_include_re.match line
@ -108,7 +109,11 @@ class Target
end
end
extra_dependencies.each { |file_name, ui_hs| file file_name => ui_hs }
extra_dependencies
end
dep_builder.call(cpp_files). each { |cpp, ui_hs| file cpp.ext('o') => ui_hs }
dep_builder.call(qobject_h_files).each { |h, ui_hs| file h. ext('moc') => ui_hs }
cpp_files << "src/#{subdir}/qt_resources.cpp" if FileTest.exists?("src/#{subdir}/qt_resources.qrc")
@ -158,6 +163,7 @@ class Target
when :flac then c(:FLAC_LIBS)
when :iconv then c(:ICONV_LIBS)
when :intl then c(:LIBINTL_LIBS)
when :cmark then c(:CMARK_LIBS)
when :boost_regex then c(:BOOST_REGEX_LIB)
when :boost_filesystem then c(:BOOST_FILESYSTEM_LIB)
when :boost_system then c(:BOOST_SYSTEM_LIB)