mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-03 21:00:01 -05:00
Merge topic 'autogen-clear-early-source-cache'
b84f1e6159 Autogen: Restore mocs_compilation in OBJECT libraries
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6024
This commit is contained in:
@@ -97,6 +97,11 @@ cmQtAutoGenGlobalInitializer::cmQtAutoGenGlobalInitializer(
|
||||
}
|
||||
std::set<std::string> const& languages =
|
||||
target->GetAllConfigCompileLanguages();
|
||||
// cmGeneratorTarget::GetAllConfigCompileLanguages caches the target's
|
||||
// sources. Clear it so that OBJECT library targets that are AUTOGEN
|
||||
// initialized after this target get their added mocs_compilation.cpp
|
||||
// source acknowledged by this target.
|
||||
target->ClearSourcesCache();
|
||||
if (languages.count("CSharp")) {
|
||||
// Don't process target if it's a CSharp target
|
||||
continue;
|
||||
|
||||
@@ -16,3 +16,8 @@ target_compile_features(b PRIVATE ${QT_COMPILE_FEATURES})
|
||||
# Executable with OBJECT library generator expressions
|
||||
add_executable(someProgram main.cpp $<TARGET_OBJECTS:a> $<TARGET_OBJECTS:b>)
|
||||
target_link_libraries(someProgram ${QT_LIBRARIES})
|
||||
|
||||
# Executable without its own AUTOMOC.
|
||||
add_executable(someProgram2 main.cpp)
|
||||
target_link_libraries(someProgram2 PRIVATE a b ${QT_LIBRARIES})
|
||||
set_property(TARGET someProgram2 PROPERTY AUTOMOC OFF)
|
||||
|
||||
@@ -10,4 +10,10 @@ CMake Error at OwnSources.cmake:[0-9]+ \(add_library\):
|
||||
Call Stack \(most recent call first\):
|
||||
CMakeLists.txt:[0-9]+ \(include\)
|
||||
+
|
||||
CMake Error at OwnSources.cmake:[0-9]+ \(add_library\):
|
||||
The SOURCES of "A" use a generator expression that depends on the SOURCES
|
||||
themselves.
|
||||
Call Stack \(most recent call first\):
|
||||
CMakeLists.txt:[0-9]+ \(include\)
|
||||
+
|
||||
CMake Generate step failed\. Build files cannot be regenerated correctly\.$
|
||||
|
||||
Reference in New Issue
Block a user