Skip to content

Commit

Permalink
CMakeLists: fixed potential linking errors around quotient_common.h
Browse files Browse the repository at this point in the history
quotient_common.h has Q_NAMESPACE but no own compilation unit, and moc
was not called on it either - using metaobject data on an enumeration
defined in that file leads to a linking error due to sharedMetaObject
not being defined. The fix makes so that the file is detected by automoc
with the respective definition being generated.

Cherry-picked from a83ec90 (0.6.x branch).
  • Loading branch information
KitsuneRal committed Jul 18, 2021
1 parent d85c63f commit e3bdbc8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,11 @@ endif ()

# Set up source files
list(APPEND lib_SRCS
# This .h is special in that it declares a Q_NAMESPACE but has no .cpp
# where staticMetaObject for that namespace would be defined; passing it
# to add_library (see below) puts it on the automoc radar, producing
# a compilation unit with the needed definition.
lib/quotient_common.h
lib/networkaccessmanager.cpp
lib/connectiondata.cpp
lib/connection.cpp
Expand Down

0 comments on commit e3bdbc8

Please sign in to comment.