Skip to content

Conversation

@star-hengxing
Copy link
Contributor

@star-hengxing star-hengxing commented Apr 2, 2025

close #5675

@waruqi waruqi closed this Apr 3, 2025
@waruqi waruqi reopened this Apr 3, 2025
@waruqi waruqi closed this Apr 3, 2025
@waruqi waruqi reopened this Apr 3, 2025
@star-hengxing star-hengxing marked this pull request as ready for review April 3, 2025 15:45
@star-hengxing
Copy link
Contributor Author

先只处理 client 的 midl 代码生成吧。

@Issues-translate-bot
Copy link

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


First, just process the midl code generation of client.

@waruqi waruqi added this to the v2.9.9 milestone Apr 6, 2025
@waruqi waruqi merged commit 0d0e484 into xmake-io:dev Apr 6, 2025
22 checks passed
@waruqi
Copy link
Member

waruqi commented Apr 6, 2025

tests下给个 example,顺带 changelog 也更新下

@Issues-translate-bot
Copy link

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


Give it an example under tests, and also update the changelog

@star-hengxing
Copy link
Contributor Author

发现 idl 文件内容会决定生成哪几个文件,否则有些文件找不到,还得再研究一下。

@Issues-translate-bot
Copy link

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


If you find that the content of the idl file will determine which files to generate, otherwise some files will not be found, so you have to study it again.

on_config(function (target)
local autogendir = path.join(target:autogendir(), "platform/windows/idl")
os.mkdir(autogendir)
target:add("includedirs", autogendir, {public = true})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这会导致所有工程都默认加上这个 includedir

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rule 里生成的头文件,如果下游 target 想用怎么办,粗粒度一点应该也不会撞吧

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

目前是所有工程 不管是否带 idl,都会带上这个 includedirs,即使没头文件冲突,但是 xmake -v 里莫名带上这个 includedirs 也很怪。

我稍微改了下,其实可以参考 windows.def 那个 rule,只有当前 target 带有 idl files ,才加上。

rule("platform.windows.idl")
set_extensions(".idl")

on_config(function (target)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里也应该限制到 windows 平台

@star-hengxing star-hengxing deleted the midl branch April 9, 2025 03:04
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

Successfully merging this pull request may close these issues.

使用xmake编译com组件问题

3 participants