Reduce warnings from moc-generated code

- The auto-generated code produces a lot of warnings from
   Clang 8; this obscures the more meaningful warnings from
   actual Calamares code, so tone the warnings down.
 - For Clang, set CALAMARES_MOC_OPTIONS.
 - Add convenience CMake function for automoccing. It applies
   the options as needed to a given target.
This commit is contained in:
Adriaan de Groot 2019-04-17 12:19:12 +02:00
parent cef2f50510
commit bdb7bf71a8
5 changed files with 48 additions and 6 deletions

View file

@ -84,10 +84,10 @@ endif()
add_library( calamares SHARED ${libSources} ${kdsagSources} ${utilsSources} )
set_target_properties( calamares
PROPERTIES
AUTOMOC TRUE
VERSION ${CALAMARES_VERSION_SHORT}
SOVERSION ${CALAMARES_VERSION_SHORT}
)
calamares_automoc( calamares )
target_link_libraries( calamares
LINK_PRIVATE
@ -114,7 +114,7 @@ if ( ECM_FOUND AND BUILD_TESTING )
Qt5::Core
Qt5::Test
)
set_target_properties( libcalamarestest PROPERTIES AUTOMOC TRUE )
calamares_automoc( libcalamarestest )
endif()
# Make symlink lib/calamares/libcalamares.so to lib/libcalamares.so.VERSION so

View file

@ -0,0 +1,4 @@
#ifdef __clang__
#pragma clang diagnostic ignored "-Wextra-semi-stmt"
#pragma clang diagnostic ignored "-Wredundant-parens"
#endif