diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx index f44c77d6e..a07444458 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -1550,7 +1550,6 @@ bool cmVSLink::Parse(std::vector::const_iterator argBeg, // pass it to the link command. this->ManifestFileRC = intDir + "/manifest.rc"; this->ManifestFileRes = intDir + "/manifest.res"; - this->LinkCommand.push_back(this->ManifestFileRes); } else if (this->UserManifests.empty()) { @@ -1658,6 +1657,9 @@ int cmVSLink::LinkIncremental() return -1; } + // Tell the linker to use our manifest compiled into a resource. + this->LinkCommand.push_back(this->ManifestFileRes); + // Run the link command (possibly generates intermediate manifest). if (!RunCommand("LINK Pass 1", this->LinkCommand, this->Verbose)) { diff --git a/Tests/MSManifest/Subdir/CMakeLists.txt b/Tests/MSManifest/Subdir/CMakeLists.txt index a47cf0030..11272bb9f 100644 --- a/Tests/MSManifest/Subdir/CMakeLists.txt +++ b/Tests/MSManifest/Subdir/CMakeLists.txt @@ -6,4 +6,6 @@ if(MSVC AND NOT MSVC_VERSION LESS 1400) COMMAND ${CMAKE_COMMAND} -Dexe=$ -P ${CMAKE_CURRENT_SOURCE_DIR}/check.cmake ) + add_executable(MSManifestNone main.c) + set_property(TARGET MSManifestNone PROPERTY LINK_FLAGS "/MANIFEST:NO") endif()