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

vsxmake生成的文件组不正确 #5589

Closed Domain closed 2 months ago

Domain commented 2 months ago

Xmake 版本

2.9.4

操作系统版本和架构

windows 10

描述问题

如果filter是当前目录,也就是".",那么就不应该生成filter,但是这一行 https://github.com/xmake-io/xmake/blob/1dfec9070bd8116c1910da1eb165ed7981e114bf/xmake/plugins/project/vsxmake/getinfo.lua#L357 会把filter变成nil,而这一行会因为nil重新计算filter https://github.com/xmake-io/xmake/blob/1dfec9070bd8116c1910da1eb165ed7981e114bf/xmake/plugins/project/vsxmake/getinfo.lua#L370

期待的结果

不要更改filter,测试发现filter = "."的时候,vs不会生成文件组,不需要特殊处理"."

工程配置

附加信息和错误日志

Issues-translate-bot commented 2 months ago

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


Title: The file group generated by vsxmake is incorrect

Xmake version

2.9.4

Operating system version and architecture

windows 10

Describe the problem

If filter is the current directory, that is, ".", then filter should not be generated, but this line https://github.com/xmake-io/xmake/blob/1dfec9070bd8116c1910da1eb165ed7981e114bf/xmake/plugins/project/vsxmake/getinfo.lua#L357 will change filter to nil, and this line will recalculate filter because of nil https://github.com/xmake-io/xmake/blob/1dfec9070bd8116c1910da1eb165ed7981e114bf/xmake/plugins/project/vsxmake/getinfo.lua#L370

Expected results

Do not change the filter. When the test finds that filter = ".", vs will not generate a file group, and no special processing of "." is required.

Project configuration

none

Additional information and error logs

None

waruqi commented 2 months ago

vs generator 里面也同步改下

https://github.com/xmake-io/xmake/blob/1dfec9070bd8116c1910da1eb165ed7981e114bf/xmake/plugins/project/vstudio/impl/vs201x_vcxproj_filters.lua#L100

Issues-translate-bot commented 2 months ago

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


Also change it simultaneously in vs generator.

https://github.com/xmake-io/xmake/blob/1dfec9070bd8116c1910da1eb165ed7981e114bf/xmake/plugins/project/vstudio/impl/vs201x_vcxproj_filters.lua#L100