summaryrefslogtreecommitdiff
path: root/xmake/plugins
diff options
context:
space:
mode:
authorruki <[email protected]>2022-03-18 22:52:57 +0800
committerruki <[email protected]>2022-03-18 22:52:57 +0800
commit1eb05ad60e90585b7f3273c5d51416ad19be72b4 (patch)
tree26491a2911a403232698a7345e8d625224a6844a /xmake/plugins
parent797901082d0b18f5652c83226cb6c6cc33931354 (diff)
detect manifest for vs generator
Diffstat (limited to 'xmake/plugins')
-rw-r--r--xmake/plugins/project/vstudio/impl/vs201x.lua9
-rw-r--r--xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua4
2 files changed, 13 insertions, 0 deletions
diff --git a/xmake/plugins/project/vstudio/impl/vs201x.lua b/xmake/plugins/project/vstudio/impl/vs201x.lua
index fa0240c4e..aa5a715e2 100644
--- a/xmake/plugins/project/vstudio/impl/vs201x.lua
+++ b/xmake/plugins/project/vstudio/impl/vs201x.lua
@@ -273,6 +273,15 @@ function _make_targetinfo(mode, arch, target, vcxprojdir)
end
targetinfo.compflags[sourcefile] = compflags
targetinfo.compargvs[sourcefile] = table.join(compiler.compargv("__sourcefile__", "__objectfile__", {sourcekind = sourcekind, target = target}))
+
+ -- detect manifest
+ -- @see https://github.com/xmake-io/xmake/issues/2176
+ if sourcekind == "mrc" and os.isfile(sourcefile) then
+ local resoucedata = io.readfile(sourcefile)
+ if resoucedata and resoucedata:find("RT_MANIFEST") then
+ targetinfo.manifest_embed = false
+ end
+ end
end
end
end
diff --git a/xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua b/xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua
index 688a12f13..0bd27177a 100644
--- a/xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua
+++ b/xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua
@@ -322,6 +322,10 @@ function _make_configurations(vcxprojfile, vsinfo, target)
vcxprojfile:print("<LinkIncremental>true</LinkIncremental>")
end
+ if targetinfo.manifest_embed ~= nil then
+ vcxprojfile:print("<EmbedManifest>%s</EmbedManifest>", targetinfo.manifest_embed)
+ end
+
-- handle ExternalIncludePath (should we handle IncludePath here too?)
local externaldirs = {}
for _, flag in ipairs(targetinfo.commonflags.cl) do