diff options
author | Brad King <brad.king@kitware.com> | 2022-02-07 17:18:31 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2022-02-07 17:19:01 (GMT) |
commit | 6b6d0d12a7b1930e2f899f34aa88a948114abe6a (patch) | |
tree | b3c056f81798e073905e046ac10bc08f083fa372 | |
parent | 4cf80f413b7f75145ad5ae61139cd75ebe8e44e4 (diff) | |
parent | feebc8394fd2aec2f4f876bab2f65879d8b1566c (diff) | |
download | CMake-6b6d0d12a7b1930e2f899f34aa88a948114abe6a.zip CMake-6b6d0d12a7b1930e2f899f34aa88a948114abe6a.tar.gz CMake-6b6d0d12a7b1930e2f899f34aa88a948114abe6a.tar.bz2 |
Merge topic 'allow_manifest_as_content'
feebc8394f Windows: Allow manifest files to be bundled as content
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6939
-rw-r--r-- | Source/cmGeneratorTarget.cxx | 6 | ||||
-rw-r--r-- | Tests/VSWinStorePhone/CMakeLists.txt | 4 | ||||
-rw-r--r-- | Tests/VSWinStorePhone/Direct3DApp1/CubeRenderer.cpp | 7 | ||||
-rw-r--r-- | Tests/VSWinStorePhone/Direct3DApp1/Simple.manifest | 1 |
4 files changed, 16 insertions, 2 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 9f1029e..602065a 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -2047,7 +2047,11 @@ void cmGeneratorTarget::ComputeKindedSources(KindedSources& files, } else if (ext == "appxmanifest") { kind = SourceKindAppManifest; } else if (ext == "manifest") { - kind = SourceKindManifest; + if (sf->GetPropertyAsBool("VS_DEPLOYMENT_CONTENT")) { + kind = SourceKindExtra; + } else { + kind = SourceKindManifest; + } } else if (ext == "pfx") { kind = SourceKindCertificate; } else if (ext == "xaml") { diff --git a/Tests/VSWinStorePhone/CMakeLists.txt b/Tests/VSWinStorePhone/CMakeLists.txt index edd4330..2cb80fa 100644 --- a/Tests/VSWinStorePhone/CMakeLists.txt +++ b/Tests/VSWinStorePhone/CMakeLists.txt @@ -63,7 +63,8 @@ set(VERTEXSHADER_FILES Direct3DApp1/SimpleVertexShader.hlsl ) -set(CONTENT_FILES ${PIXELSHADER_FILES} ${VERTEXSHADER_FILES}) + set(COPY_TO_OUTPUT_FILES Direct3DApp1/Simple.manifest) + set(CONTENT_FILES ${PIXELSHADER_FILES} ${VERTEXSHADER_FILES} ${COPY_TO_OUTPUT_FILES}) if (WINDOWS_PHONE8) set(CONTENT_FILES ${CONTENT_FILES} @@ -108,6 +109,7 @@ set(RESOURCE_FILES ${CONTENT_FILES} ${DEBUG_CONTENT_FILES} ${RELEASE_CONTENT_FILES} ${ASSET_FILES} ${STRING_FILES} Direct3DApp1/Direct3DApp1_TemporaryKey.pfx) +set_property(SOURCE ${COPY_TO_OUTPUT_FILES} PROPERTY VS_COPY_TO_OUT_DIR "PreserveNewest") set_property(SOURCE ${CONTENT_FILES} PROPERTY VS_DEPLOYMENT_CONTENT 1) set_property(SOURCE ${ASSET_FILES} PROPERTY VS_DEPLOYMENT_CONTENT 1) set_property(SOURCE ${ASSET_FILES} PROPERTY VS_DEPLOYMENT_LOCATION "Assets") diff --git a/Tests/VSWinStorePhone/Direct3DApp1/CubeRenderer.cpp b/Tests/VSWinStorePhone/Direct3DApp1/CubeRenderer.cpp index 595f553..d287857 100644 --- a/Tests/VSWinStorePhone/Direct3DApp1/CubeRenderer.cpp +++ b/Tests/VSWinStorePhone/Direct3DApp1/CubeRenderer.cpp @@ -17,6 +17,13 @@ CubeRenderer::CubeRenderer() // Create a new WinRT object to validate that we can link properly Batman ^ hero = ref new Batman(); hero->savePeople(); + + // Test that .manifest files can be bundled with app + DX::ReadDataAsync("Direct3DApp1\\Simple.manifest") + .then([this](Platform::Array<byte> ^ fileData) { + std::string manifestContent(fileData->begin(), fileData->end()); + assert(manifestContent.find("hello") == 0); + }); } void CubeRenderer::CreateDeviceResources() diff --git a/Tests/VSWinStorePhone/Direct3DApp1/Simple.manifest b/Tests/VSWinStorePhone/Direct3DApp1/Simple.manifest new file mode 100644 index 0000000..ce01362 --- /dev/null +++ b/Tests/VSWinStorePhone/Direct3DApp1/Simple.manifest @@ -0,0 +1 @@ +hello |