Fix Ubuntu 18.04 Qt FTBFS (#1377)

* fix: avoid qt5_add_translation options on old qt5

Check the Qt5Linguist version before passing 'OPTIONS -silent' to
qt5_add_translation(). 'OPTIONS' arg support was merged 2018-01-12
https://codereview.qt.nokia.com/gitweb?p=qt%2Fqttools.git;a=commit;h=9f3dba2ea3978936565aa5e7893415a8a765268e
and made it into the 5.11 release on 2018-05-22.

* fix: ftbfs include <cassert> before using assert()
This commit is contained in:
Charles Kerr 2020-07-29 14:53:55 -05:00 committed by GitHub
parent 8f12792186
commit 77ced2b7c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -194,5 +194,9 @@ macro(tr_qt_add_resources)
endmacro()
macro(tr_qt_add_translation)
qt5_add_translation(${ARGN} OPTIONS -silent)
if (Qt5LinguistTools_VERSION VERSION_LESS 5.11.0)
qt5_add_translation(${ARGN})
else()
qt5_add_translation(${ARGN} OPTIONS -silent)
endif()
endmacro()

View File

@ -7,6 +7,7 @@
*/
#include <algorithm>
#include <cassert>
#include <iostream>
#include <utility>