Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

packages runtime 与 --vs_runtime 不符 #209

Open
nil-ref opened this issue Mar 11, 2023 · 3 comments
Open

packages runtime 与 --vs_runtime 不符 #209

nil-ref opened this issue Mar 11, 2023 · 3 comments

Comments

@nil-ref
Copy link

nil-ref commented Mar 11, 2023

在用参数: xmake f -m debug --vs_runtime=MDd -k static --demo=n --small=n --openssl=n --polarssl=n 配置 tbox 后

......
checking for windows__InterlockedExchange8_rel ... no
checking for windows__InterlockedExchange8_nf ... no
checking for windows__InterlockedCompareExchange_nf ... no
checking for windows__InterlockedExchange_rel ... no
checking for windows__InterlockedCompareExchange64_rel ... no
checking for windows__InterlockedCompareExchange ... no
note: install or modify (m) these packages (pass -y to skip confirm)?
in xmake-repo:
  -> zlib v1.2.13 [optional, vs_runtime:"MTd", from:pcre]
  -> sqlite3 3.39.0+200 [optional, vs_runtime:"MTd"]
  -> mbedtls 2.13.0 [optional, vs_runtime:"MTd"]
  -> pcre2 10.40 [optional, vs_runtime:"MTd"]
     or pcre 8.45 [optional, vs_runtime:"MTd"]
please input: y (y/n/m)

这里预期 packages vs_runtime 是 MDd. 可实际编译的是 MTd 的 runtime.

@nil-ref
Copy link
Author

nil-ref commented Mar 11, 2023

在手动修改脚本 xmake.lua, 关键位置 add_requires 加入 configs = {vs_runtime = "MDd"} 后. 能顺利编译. 但是在VS使用的过程中遇到: warning LNK4099: 未找到 PDB“” 的提示.

发现在 Local.xmake\packages\m\mbedtls\2.13.0\65246ccd0cf34d1fa5829fbe8953be40\lib 中不存在 pdb. 这里是不是可以在编译第三方包的时候保留 pdb 以方便调试?

@nil-ref
Copy link
Author

nil-ref commented Mar 11, 2023

或者可以将符号嵌入 debug 模式下的静态 lib. 参考: microsoft/vcpkg@f7b813d

@waruqi
Copy link
Member

waruqi commented Mar 11, 2023

目前这个项目不打算对 md 做支持,你可以自己 xmake.lua 里面全局设置下 set_runtime("MDd") 去编译。

发现在 Local.xmake\packages\m\mbedtls\2.13.0\65246ccd0cf34d1fa5829fbe8953be40\lib 中不存在 pdb. 这里是不是可以在编译第三方包的时候保留 pdb 以方便调试?

保留 pdb 很占空间,目前不会在包里,特定去保留它。

想要调试包,可以自己将 add_requires("xxx", {debug = true}) 切到调试版本的包,但前提是这些包 对 debug config 做了处理。。目前不是所有包都加了 debug 切换。。得自己到 xmake-repo 仓库看下。。

切到 debug config ,通常包自身安装,会顺带安装 pdb ,前提是这个包的构建脚本有做处理

或者自己搞个本地仓库,改下包配置,用自己的包

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants