Browse Source

Merge branch 'vs-csharp-in-custom-target' into release-3.13

Merge-request: !2515
Brad King 7 years ago
parent
commit
35fe47bd5d

+ 4 - 0
Source/cmVisualStudio10TargetGenerator.cxx

@@ -1133,6 +1133,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]);

+ 3 - 0
Tests/CSharpOnly/CMakeLists.txt

@@ -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 - 0
Tests/CSharpOnly/empty.cs


+ 0 - 0
Tests/CSharpOnly/empty.txt