From 8dc6b69a8cfa72543262fdefb7295d44e472129f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= Date: Wed, 27 Sep 2023 01:46:01 +0200 Subject: [PATCH 1/3] Remove redundant includes --- src/test/ringdelaybuffer_test.cpp | 1 - src/util/ringdelaybuffer.cpp | 2 -- 2 files changed, 3 deletions(-) diff --git a/src/test/ringdelaybuffer_test.cpp b/src/test/ringdelaybuffer_test.cpp index 8cbb80bfc56..9f3f5a788b1 100644 --- a/src/test/ringdelaybuffer_test.cpp +++ b/src/test/ringdelaybuffer_test.cpp @@ -6,7 +6,6 @@ #include #include -#include #include "test/mixxxtest.h" #include "util/samplebuffer.h" diff --git a/src/util/ringdelaybuffer.cpp b/src/util/ringdelaybuffer.cpp index 3915c97b4ea..1981647c6c5 100644 --- a/src/util/ringdelaybuffer.cpp +++ b/src/util/ringdelaybuffer.cpp @@ -1,7 +1,5 @@ #include "ringdelaybuffer.h" -#include - #include "util/math.h" #include "util/sample.h" From 10a45a3d1132735e4b6ec9e2e800f15a8a22db0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= Date: Wed, 27 Sep 2023 01:46:56 +0200 Subject: [PATCH 2/3] Revert "chore: Remove `moc_included_test.cpp`" This reverts commit 2ec66c89d2f58a344102d6c0beabec78945cf16d. --- CMakeLists.txt | 2 ++ src/util/moc_included_test.cpp | 8 ++++++++ 2 files changed, 10 insertions(+) create mode 100644 src/util/moc_included_test.cpp 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 From 97255f863804a82ba8637629c51f051f1cfa9761 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= Date: Wed, 27 Sep 2023 02:16:13 +0200 Subject: [PATCH 3/3] moc_included_test.cpp requires SKIP_PRECOMPILE_HEADERS ON --- CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9df65580085..7f3cd60b14f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1477,6 +1477,8 @@ else() endif() endif() +set_source_files_properties(src/util/moc_included_test.cpp PROPERTIES SKIP_PRECOMPILE_HEADERS ON) + set_target_properties(mixxx-lib PROPERTIES AUTOMOC ON AUTOUIC ON CXX_CLANG_TIDY "${CLANG_TIDY}") target_include_directories(mixxx-lib PUBLIC src "${CMAKE_CURRENT_BINARY_DIR}/src") if(UNIX AND NOT APPLE)