mirror of
https://github.com/Kitware/CMake.git
synced 2025-12-31 10:50:16 -06:00
VS: Fix crash on CSharp sources in a custom target
The target generator does not compute ClOptions for custom targets, so we should not use them either. Fixes: #18377, #18485
This commit is contained in:
@@ -1130,6 +1130,10 @@ void cmVisualStudio10TargetGenerator::WriteMSToolConfigurationValues(
|
||||
void cmVisualStudio10TargetGenerator::WriteMSToolConfigurationValuesManaged(
|
||||
Elem& e1, std::string const& config)
|
||||
{
|
||||
if (this->GeneratorTarget->GetType() > cmStateEnums::OBJECT_LIBRARY) {
|
||||
return;
|
||||
}
|
||||
|
||||
cmGlobalVisualStudio10Generator* gg = this->GlobalGenerator;
|
||||
|
||||
Options& o = *(this->ClOptions[config]);
|
||||
|
||||
@@ -8,3 +8,6 @@ add_library(lib2 SHARED lib2.cs)
|
||||
add_executable(CSharpOnly csharponly.cs)
|
||||
|
||||
target_link_libraries(CSharpOnly lib1 lib2)
|
||||
|
||||
add_custom_target(CSharpCustom SOURCES empty.cs)
|
||||
add_custom_target(custom.cs DEPENDS empty.txt)
|
||||
|
||||
0
Tests/CSharpOnly/empty.cs
Normal file
0
Tests/CSharpOnly/empty.cs
Normal file
0
Tests/CSharpOnly/empty.txt
Normal file
0
Tests/CSharpOnly/empty.txt
Normal file
Reference in New Issue
Block a user