Closed fxliang closed 2 months ago
用 set_policy("windows.manifest.uac", "invoker")
和 add_files("src/*.manifest")
https://xmake.io/#/guide/build_policies?id=windowsmanifestuac https://github.com/xmake-io/xmake/issues/1241#issuecomment-782985651 https://github.com/xmake-io/xmake/pull/4369#issuecomment-1797980473 https://github.com/xmake-io/xmake/blob/dev/xmake/rules/platform/windows/manifest/xmake.lua
也就是,只能复制那个PerMonitorDPIAware.manifest出来放$(projectdir)下来用了?
Bot detected the issue body's language is not English, translate it automatically.
In other words, you can only copy the PerMonitorDPIAware.manifest and put it in $(projectdir) for use?
rule 里面走 target:add("files", "xxx.manifest")
也可以。。
如果非要自己 add ldflags,和参考上面链接里面的代码实现。。你 add 的方式也不对
Bot detected the issue body's language is not English, translate it automatically.
You can also use
target:add("files", "xxx.manifest")
in the rule. .
If you have to add ldflags yourself, please refer to the code implementation in the link above. . The way you add is also wrong
试了这样添加确实是可以的,只不过有一个target 要admin,又想permonitordpiaware,目前这样似乎是不行的。我见有代码注释描述只要有manifest就取消uac
Bot detected the issue body's language is not English, translate it automatically.
It is indeed possible to add it this way, but there is a target that requires admin, and I want to monitordpiaware. This seems to be not possible at the moment. I saw a code comment describing how to cancel uac as long as there is a manifest.
https://github.com/xmake-io/xmake/blob/dev/xmake/rules/platform/windows/manifest/xmake.lua
当初是为了解决这个 https://github.com/xmake-io/xmake/pull/4362
不行,就自己 add ldflags 好了,你之前的配置语法不对而已。参考这个自己改下就行了
Bot detected the issue body's language is not English, translate it automatically.
https://github.com/xmake-io/xmake/blob/dev/xmake/rules/platform/windows/manifest/xmake.lua
It was originally to solve this https://github.com/xmake-io/xmake/pull/4362
No, just add ldflags yourself. Your previous configuration syntax was just wrong. Just refer to this and change it yourself.
OK
Xmake 版本
2.9.3+HEAD.4458811b1
操作系统版本和架构
Microsoft Windows 10 10.0.19044
描述问题
build process as bellow
modified the link command and it worked
key diff is on the ldflags
期待的结果
build successfully
工程配置
main.cpp
xmake.lua
附加信息和错误日志
none