mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-05 22:00:10 -05: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(
|
void cmVisualStudio10TargetGenerator::WriteMSToolConfigurationValuesManaged(
|
||||||
Elem& e1, std::string const& config)
|
Elem& e1, std::string const& config)
|
||||||
{
|
{
|
||||||
|
if (this->GeneratorTarget->GetType() > cmStateEnums::OBJECT_LIBRARY) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
cmGlobalVisualStudio10Generator* gg = this->GlobalGenerator;
|
cmGlobalVisualStudio10Generator* gg = this->GlobalGenerator;
|
||||||
|
|
||||||
Options& o = *(this->ClOptions[config]);
|
Options& o = *(this->ClOptions[config]);
|
||||||
|
|||||||
@@ -8,3 +8,6 @@ add_library(lib2 SHARED lib2.cs)
|
|||||||
add_executable(CSharpOnly csharponly.cs)
|
add_executable(CSharpOnly csharponly.cs)
|
||||||
|
|
||||||
target_link_libraries(CSharpOnly lib1 lib2)
|
target_link_libraries(CSharpOnly lib1 lib2)
|
||||||
|
|
||||||
|
add_custom_target(CSharpCustom SOURCES empty.cs)
|
||||||
|
add_custom_target(custom.cs DEPENDS empty.txt)
|
||||||
|
|||||||
Reference in New Issue
Block a user