xmake-io / xmake

🔥 A cross-platform build utility based on Lua
https://xmake.io
Apache License 2.0
10.14k stars 782 forks source link

Improve copy pdb with cmake package #5566

Closed star-hengxing closed 1 month ago

star-hengxing commented 2 months ago

Xmake Version

dev

Operating System Version and Architecture

Windows

Describe Bug

add_requires("flecs", {debug = true, system = false, configs = {shared = true}})

install dir:

$ eza -T bin
bin
├── flecs.dll
└── vc140.pdb
$ eza -T lib
lib
├── cmake
│  └── flecs
│     ├── flecs-config-debug.cmake
│     └── flecs-config.cmake
├── flecs.lib
└── pkgconfig
   └── flecs.pc

build dir:

$ eza --long
-a---  94k  4 build.ninja
-a--- 4.6k  4 cmake_install.cmake
-a---  18k  4 CMakeCache.txt
d----    -  4 CMakeFiles
-a--- 3.6M  4 flecs.dll
-a--- 129k  4 flecs.exp
-a--- 5.7M  4 flecs.ilk
-a--- 196k  4 flecs.lib
-a---  10M  4 flecs.pdb
d----    -  4 install
-a---  22k  4 install_manifest.txt
d----    -  4 pdb

The install dir missing flecs.pdb.

Expected Behavior

Improve this code or patch cmakelists (How?)

https://github.com/xmake-io/xmake/blob/b7ef860d94d16822e75d56b6f48ad3416913e095/xmake/modules/package/tools/cmake.lua#L1254-L1260

Project Configuration

N/A

Additional Information and Error Logs

N/A

waruqi commented 2 months ago

这种没办法,cmake 里面搞得这么随意,要么只能改成 **.pdb ,全目录搜,但这样可能会影响安装速度,要是文件太多,安装会变得很慢。

要么只能针对特定包,install 后,额外 os.cp 下就行了。

Issues-translate-bot commented 2 months ago

Bot detected the issue body's language is not English, translate it automatically.


There is no way around this, cmake is so random, or you can only change it to **.pdb and search the whole directory, but this may affect the installation speed. If there are too many files, the installation will become very slow.

Or it can only be used for specific packages. After installation, just download the additional os.cp.

star-hengxing commented 1 month ago

估计只有用 msbuild 构建,pdb 才会稳定生成在 build dir/<msbuild build type>/*.pdb。 ninja 会生成在 build dir/src/ (与源码目录名字相关) 等位置,很神秘。而且有时候 shared 才会生成,static 很多时候都没有。

目前在更新包的时候只考虑适配 ninja 了,毕竟其他包管理都是用 ninja 的。

waruqi commented 1 month ago

现在路径位置不确定,不太好搞。。而且一个包,有可能需要同时 copy到 bin/lib

不确定性太多,没有个统一的输出规范

Issues-translate-bot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically.


It is estimated that only when built with msbuild, pdb will be stably generated in build dir/<msbuild build type>/*.pdb. Ninja will be generated in build dir/src/ (related to the source code directory name) and other locations, which is very mysterious. And sometimes shared will be generated, and static will not be generated in many cases.

Currently, when updating packages, we only consider adapting to ninja. After all, other package management uses ninja.

Issues-translate-bot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically.


The path location is now uncertain and not easy to handle. . Moreover, a package may need to be copied to bin/lib at the same time.

There are too many uncertainties and there is no unified output specification.