gradle-native icon indicating copy to clipboard operation
gradle-native copied to clipboard

Support the midl.exe compiler

Open pedrolamarao opened this issue 7 years ago • 4 comments

Native development on Windows sometimes requires processing IDL files. Visual Studio C++ includes de midl.exe compiler for this purpose. This tool is a "source generation" tool.

It takes *.idl as input and generates headers and source files as output.

I have investigated the option of writing custom tasks for this purpose but the midl.exe requires other parts of the toolset to be present in the PATH -- similarly to the resource compiler tool.

I am interested in contributing work for this project.

pedrolamarao avatar Apr 18 '18 19:04 pedrolamarao

You could copy/paste the Windows Ressource Compiler plugin from Gradle and start to adapt it for midl.exe

zosrothko avatar Apr 19 '18 06:04 zosrothko

Thanks @pedrolamarao for this issue. This work is bigger than simply adding midl compiler. We realized some time ago the toolchain infrastructure isn't as expendable as it should be. The next work should be looking at making it more flexible so users can add whatever tools they need from toolchain installation. @zosrothko suggestion is a good workaround at this moment.

lacasseio avatar Apr 19 '18 09:04 lacasseio

I will attempt to follow @zosrothko suggestion.

pedrolamarao avatar Apr 19 '18 17:04 pedrolamarao

I'd like to add a comment based on our experience migrating from msbuild to gradle. We did hack something together to compile IDL files. Our hack generates an @OutputDirectory with sources, headers and TLB files. This is supposed to go in the include path of dependent projects. Currently, the native plugins accept a single publicHeader path. We are yet unsure what is the best approach: to generate files inside the original include-source tree, or, to copy the original include-source tree to the generated files directory. If multiple publicHeaders are still on topic, this seems a vote for it.

pedrolamarao avatar Nov 27 '19 20:11 pedrolamarao