diff options
author | Michael Stürmer <michael.stuermer@schaeffler.com> | 2018-04-13 05:43:09 (GMT) |
---|---|---|
committer | Michael Stürmer <michael.stuermer@schaeffler.com> | 2018-04-23 05:31:20 (GMT) |
commit | 709277640b577adc98bd2cead613b3c79a5546dd (patch) | |
tree | 639426e362b0768a508a98849250521e5d4ce087 | |
parent | 24182325860e058f59e2a01bbde92e735dd8357b (diff) | |
download | CMake-709277640b577adc98bd2cead613b3c79a5546dd.zip CMake-709277640b577adc98bd2cead613b3c79a5546dd.tar.gz CMake-709277640b577adc98bd2cead613b3c79a5546dd.tar.bz2 |
cmExportFileGenerator: set IMPORTED_COMMON_LANGUAGE_RUNTIME for CSharp target
-rw-r--r-- | Source/cmExportFileGenerator.cxx | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx index 8894d44..bf9d341 100644 --- a/Source/cmExportFileGenerator.cxx +++ b/Source/cmExportFileGenerator.cxx @@ -786,9 +786,14 @@ void cmExportFileGenerator::SetImportDetailProperties( std::string propval; if (auto* p = target->GetProperty("COMMON_LANGUAGE_RUNTIME")) { propval = p; + } else if (target->HasLanguage("CSharp", config)) { + // C# projects do not have the /clr flag, so we set the property + // here to mark the target as (only) managed (i.e. no .lib file + // to link to). Otherwise the COMMON_LANGUAGE_RUNTIME target + // property would have to be set manually for C# targets to make + // exporting/importing work. + propval = "CSharp"; } - // TODO: make sure propval is set to non-empty string for - // CSharp targets (i.e. force ManagedType::Managed). properties[prop] = propval; } } |