diff options
author | Cristian Adam <cristian.adam@gmail.com> | 2020-07-29 15:33:00 (GMT) |
---|---|---|
committer | Cristian Adam <cristian.adam@gmail.com> | 2020-07-29 15:57:50 (GMT) |
commit | 7051250a6c040a8705b57168a71dfb14b4055b13 (patch) | |
tree | ba7948e85278120ae0c575340fdba850145f579d | |
parent | 7b4ffd4d25712484ff815e446db366124f6edf66 (diff) | |
download | CMake-7051250a6c040a8705b57168a71dfb14b4055b13.zip CMake-7051250a6c040a8705b57168a71dfb14b4055b13.tar.gz CMake-7051250a6c040a8705b57168a71dfb14b4055b13.tar.bz2 |
Unity Builds: Do not set SKIP_AUTOGEN to source files
Fixes: #21028
-rw-r--r-- | Source/cmLocalGenerator.cxx | 1 | ||||
-rw-r--r-- | Tests/QtAutogen/Tests.cmake | 1 | ||||
-rw-r--r-- | Tests/QtAutogen/UnityMocSource/CMakeLists.txt | 12 | ||||
-rw-r--r-- | Tests/QtAutogen/UnityMocSource/library.cpp | 6 | ||||
-rw-r--r-- | Tests/QtAutogen/UnityMocSource/main.cpp | 4 |
5 files changed, 23 insertions, 1 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 3b3f110..e26dc94 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -2848,7 +2848,6 @@ inline void RegisterUnitySources(cmGeneratorTarget* target, cmSourceFile* sf, { target->AddSourceFileToUnityBatch(sf->ResolveFullPath()); sf->SetProperty("UNITY_SOURCE_FILE", filename.c_str()); - sf->SetProperty("SKIP_AUTOGEN", "ON"); } inline void IncludeFileInUnitySources(cmGeneratedFileStream& unity_file, diff --git a/Tests/QtAutogen/Tests.cmake b/Tests/QtAutogen/Tests.cmake index a19a9ae..dfa5ea0 100644 --- a/Tests/QtAutogen/Tests.cmake +++ b/Tests/QtAutogen/Tests.cmake @@ -29,6 +29,7 @@ ADD_AUTOGEN_TEST(UicInterface QtAutoUicInterface) ADD_AUTOGEN_TEST(UicNoGui uicNoGui) ADD_AUTOGEN_TEST(UicOnly uicOnly) ADD_AUTOGEN_TEST(UicSkipSource) +ADD_AUTOGEN_TEST(UnityMocSource) if(QT_TEST_ALLOW_QT_MACROS) ADD_AUTOGEN_TEST(MocCMP0071) diff --git a/Tests/QtAutogen/UnityMocSource/CMakeLists.txt b/Tests/QtAutogen/UnityMocSource/CMakeLists.txt new file mode 100644 index 0000000..d472319 --- /dev/null +++ b/Tests/QtAutogen/UnityMocSource/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.16) +project(UnityMocSource) +include("../AutogenGuiTest.cmake") + +set(CMAKE_AUTOMOC ON) +set(CMAKE_UNITY_BUILD ON) + +add_library(library library.cpp) +target_link_libraries(library ${QT_LIBRARIES}) + +add_executable(unityMocSource main.cpp) +target_link_libraries(unityMocSource PRIVATE library) diff --git a/Tests/QtAutogen/UnityMocSource/library.cpp b/Tests/QtAutogen/UnityMocSource/library.cpp new file mode 100644 index 0000000..1e30d4b --- /dev/null +++ b/Tests/QtAutogen/UnityMocSource/library.cpp @@ -0,0 +1,6 @@ +#include <QObject> +class Test : public QObject +{ + Q_OBJECT +}; +#include "library.moc" diff --git a/Tests/QtAutogen/UnityMocSource/main.cpp b/Tests/QtAutogen/UnityMocSource/main.cpp new file mode 100644 index 0000000..f8b643a --- /dev/null +++ b/Tests/QtAutogen/UnityMocSource/main.cpp @@ -0,0 +1,4 @@ +int main() +{ + return 0; +} |