diff options
author | Gilles Khouzam <gillesk@microsoft.com> | 2019-02-01 17:40:58 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-02-01 18:04:52 (GMT) |
commit | cff026dbc01f975857236a11fc033af48b5e130a (patch) | |
tree | b9d95dad15a93df1bc6f41084731451893c88a6e /Source/cmVisualStudio10TargetGenerator.cxx | |
parent | 6c21722adbc1745b6362ca9501692805c19eb8ac (diff) | |
download | CMake-cff026dbc01f975857236a11fc033af48b5e130a.zip CMake-cff026dbc01f975857236a11fc033af48b5e130a.tar.gz CMake-cff026dbc01f975857236a11fc033af48b5e130a.tar.bz2 |
VS: Fix WinRT component references
WinRT components need to be referenced in a similar way that managed
code libraries are referenced. Validate that the library reference is a
WinRT component and reference it through the project.
Add test coverage for `VS_WINRT_COMPONENT`. While at it, fix the IOT
reference failing on Win10 SDK 17763 which doesn't include it anymore.
Fixes: #18846
Diffstat (limited to 'Source/cmVisualStudio10TargetGenerator.cxx')
-rw-r--r-- | Source/cmVisualStudio10TargetGenerator.cxx | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 9d7dd07..c4040e1 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -3884,8 +3884,8 @@ void cmVisualStudio10TargetGenerator::WriteProjectReferences(Elem& e0) this->WriteDotNetReferenceCustomTags(e2, name); // If the dependency target is not managed (compiled with /clr or - // C# target) we cannot reference it and have to set - // 'ReferenceOutputAssembly' to false. + // C# target) and not a WinRT component we cannot reference it and + // have to set 'ReferenceOutputAssembly' to false. auto referenceNotManaged = dt->GetManagedType("") < cmGeneratorTarget::ManagedType::Mixed; // Workaround to check for manually set /clr flags. @@ -3902,6 +3902,12 @@ void cmVisualStudio10TargetGenerator::WriteProjectReferences(Elem& e0) if (referenceNotManaged && dt->GetType() == cmStateEnums::STATIC_LIBRARY) { referenceNotManaged = !dt->IsCSharpOnly(); } + + // Referencing WinRT components is okay. + if (referenceNotManaged) { + referenceNotManaged = !dt->GetPropertyAsBool("VS_WINRT_COMPONENT"); + } + if (referenceNotManaged) { e2.Element("ReferenceOutputAssembly", "false"); e2.Element("CopyToOutputDirectory", "Never"); |