diff options
author | Brad King <brad.king@kitware.com> | 2015-09-29 14:08:13 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2015-09-29 14:08:13 (GMT) |
commit | 130f11634073e259b9ea1b48ab341dc7ac2ce4b9 (patch) | |
tree | ef909c6ce730609767c8a95e7228bc373e29f806 | |
parent | ee1b04110866d1e6bddba2346c0cc19507fc6ed0 (diff) | |
parent | 9bc6eb8e1f50d50bcbcf5b95f7121c31eb10abf2 (diff) | |
download | CMake-130f11634073e259b9ea1b48ab341dc7ac2ce4b9.zip CMake-130f11634073e259b9ea1b48ab341dc7ac2ce4b9.tar.gz CMake-130f11634073e259b9ea1b48ab341dc7ac2ce4b9.tar.bz2 |
Merge topic 'fix-qtautogen-with-object-library-Ninja'
9bc6eb8e cmGlobalGenerator: Initialize generator targets on construction (#15729)
-rw-r--r-- | Source/cmGeneratorTarget.cxx | 2 | ||||
-rw-r--r-- | Source/cmGlobalGenerator.cxx | 15 | ||||
-rw-r--r-- | Source/cmGlobalGenerator.h | 1 | ||||
-rw-r--r-- | Tests/QtAutogen/CMakeLists.txt | 9 | ||||
-rw-r--r-- | Tests/QtAutogen/targetObjectsTest.cpp | 5 |
5 files changed, 15 insertions, 17 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 555c437..62598f4 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -275,6 +275,8 @@ cmGeneratorTarget::cmGeneratorTarget(cmTarget* t, cmLocalGenerator* lg) this->LocalGenerator = lg; this->GlobalGenerator = this->LocalGenerator->GetGlobalGenerator(); + this->GlobalGenerator->ComputeTargetObjectDirectory(this); + CreatePropertyGeneratorExpressions( t->GetIncludeDirectoriesEntries(), t->GetIncludeDirectoriesBacktraces(), diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 540bd01..4a48b5d 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -1263,8 +1263,6 @@ bool cmGlobalGenerator::Compute() this->LocalGenerators[i]->AddHelperCommands(); } - this->InitGeneratorTargets(); - #ifdef CMAKE_BUILD_WITH_CMAKE for (std::vector<cmTarget const*>::iterator it = autogenTargets.begin(); it != autogenTargets.end(); ++it) @@ -1558,19 +1556,6 @@ void cmGlobalGenerator::CreateGeneratorTargets(TargetTypes targetTypes, } //---------------------------------------------------------------------------- -void cmGlobalGenerator::InitGeneratorTargets() -{ - for(cmGeneratorTargetsType::iterator ti = - this->GeneratorTargets.begin(); ti != this->GeneratorTargets.end(); ++ti) - { - if (!ti->second->Target->IsImported()) - { - this->ComputeTargetObjectDirectory(ti->second); - } - } -} - -//---------------------------------------------------------------------------- void cmGlobalGenerator::CreateGeneratorTargets(TargetTypes targetTypes) { // Construct per-target generator information. diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index 88a03ca..ba74c9e 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -480,7 +480,6 @@ private: cmGeneratorTargetsType GeneratorTargets; friend class cmake; void CreateGeneratorTargets(TargetTypes targetTypes, cmLocalGenerator* lg); - void InitGeneratorTargets(); void CreateGeneratorTargets(TargetTypes targetTypes); void ClearGeneratorMembers(); diff --git a/Tests/QtAutogen/CMakeLists.txt b/Tests/QtAutogen/CMakeLists.txt index ebcfc0f..d5aca55 100644 --- a/Tests/QtAutogen/CMakeLists.txt +++ b/Tests/QtAutogen/CMakeLists.txt @@ -101,7 +101,14 @@ add_executable(QtAutogen main.cpp calwidget.cpp second_widget.cpp foo.cpp blub.c ) set_property(TARGET QtAutogen APPEND PROPERTY AUTOGEN_TARGET_DEPENDS generate_moc_input "${CMAKE_CURRENT_BINARY_DIR}/myotherinterface.h") -set_target_properties(QtAutogen codeeditorLib privateSlot PROPERTIES AUTOMOC TRUE) +add_executable(targetObjectsTest targetObjectsTest.cpp $<TARGET_OBJECTS:privateSlot>) +target_link_libraries(targetObjectsTest ${QT_LIBRARIES}) + +set_target_properties( + QtAutogen codeeditorLib privateSlot targetObjectsTest + PROPERTIES + AUTOMOC TRUE +) include(GenerateExportHeader) # The order is relevant here. B depends on A, and B headers depend on A diff --git a/Tests/QtAutogen/targetObjectsTest.cpp b/Tests/QtAutogen/targetObjectsTest.cpp new file mode 100644 index 0000000..766b775 --- /dev/null +++ b/Tests/QtAutogen/targetObjectsTest.cpp @@ -0,0 +1,5 @@ + +int main() +{ + return 0; +} |