-
-
Notifications
You must be signed in to change notification settings - Fork 835
Add msvc midl support #6279
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
Add msvc midl support #6279
Conversation
先只处理 client 的 midl 代码生成吧。 |
First, just process the midl code generation of client. |
tests下给个 example,顺带 changelog 也更新下 |
Give it an example under tests, and also update the changelog |
发现 idl 文件内容会决定生成哪几个文件,否则有些文件找不到,还得再研究一下。 |
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}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这会导致所有工程都默认加上这个 includedir
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rule 里生成的头文件,如果下游 target 想用怎么办,粗粒度一点应该也不会撞吧
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里也应该限制到 windows 平台
close #5675