mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-09 15:20:56 -06:00
cmGlobalGenerator: Only compute build files for all targets
If we're creating generation objects for imported targets only, we don't need the export sets. Only compute build file generators if generating for all targets. Fixes: #23709
This commit is contained in:
@@ -1361,7 +1361,9 @@ void cmGlobalGenerator::CreateGenerationObjects(TargetTypes targetTypes)
|
||||
this->CheckTargetProperties();
|
||||
}
|
||||
this->CreateGeneratorTargets(targetTypes);
|
||||
this->ComputeBuildFileGenerators();
|
||||
if (targetTypes == TargetTypes::AllTargets) {
|
||||
this->ComputeBuildFileGenerators();
|
||||
}
|
||||
}
|
||||
|
||||
void cmGlobalGenerator::CreateImportedGenerationObjects(
|
||||
|
||||
@@ -18,3 +18,4 @@ run_cmake(DependOnDoubleExport)
|
||||
run_cmake(UnknownExport)
|
||||
run_cmake(NamelinkOnlyExport)
|
||||
run_cmake(SeparateNamelinkExport)
|
||||
run_cmake(TryCompileExport)
|
||||
|
||||
9
Tests/RunCMake/export/TryCompileExport.cmake
Normal file
9
Tests/RunCMake/export/TryCompileExport.cmake
Normal file
@@ -0,0 +1,9 @@
|
||||
enable_language(CXX)
|
||||
|
||||
add_library(interface INTERFACE)
|
||||
install(TARGETS interface EXPORT export)
|
||||
export(EXPORT export)
|
||||
|
||||
add_library(imported IMPORTED INTERFACE)
|
||||
|
||||
try_compile(tc "${CMAKE_CURRENT_BINARY_DIR}/tc" "${CMAKE_CURRENT_SOURCE_DIR}/empty.cpp" LINK_LIBRARIES imported)
|
||||
Reference in New Issue
Block a user