diff --git a/CMakeLists.txt b/CMakeLists.txt index 3e1acdd627e..9df65580085 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1094,6 +1094,7 @@ add_library(mixxx-lib STATIC EXCLUDE_FROM_ALL src/util/logger.cpp src/util/logging.cpp src/util/mac.cpp + src/util/moc_included_test.cpp src/util/movinginterquartilemean.cpp src/util/performancetimer.cpp src/util/rangelist.cpp @@ -2092,6 +2093,7 @@ add_executable(mixxx-test src/test/wbatterytest.cpp src/test/wpushbutton_test.cpp src/test/wwidgetstack_test.cpp + src/util/moc_included_test.cpp ) find_package(GTest CONFIG REQUIRED) set_target_properties(mixxx-test PROPERTIES AUTOMOC ON) diff --git a/src/util/moc_included_test.cpp b/src/util/moc_included_test.cpp new file mode 100644 index 00000000000..605693a25e5 --- /dev/null +++ b/src/util/moc_included_test.cpp @@ -0,0 +1,8 @@ +#include "../mocs_compilation.cpp" + +// QT_VERSION will be defined by any moc_.cpp file included from mocs_compilation.cpp +// It is empty in case all moc files are included, a requirement to speed up incremental builds. +// See https://cmake.org/cmake/help/latest/prop_tgt/AUTOMOC.html for details. +#ifdef QT_VERSION +#error mocs_compilation.cpp not empty. Move all #include "moc_.cpp" lines from mocs_compilation.cpp to the cpp files of the related classes. +#endif