Skip to content
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

Make it possible to customize MIDL parameters #1428

Closed
abolade opened this issue Jan 13, 2023 · 3 comments
Closed

Make it possible to customize MIDL parameters #1428

abolade opened this issue Jan 13, 2023 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@abolade
Copy link

abolade commented Jan 13, 2023

The problem: MetadataTasks.dll currently uses hard-coded parameters for MIDL compilation. However, certain IDL files require that /notlb be specified as a parameter (e.g. those using system_handle(...) parameters on interface methods), as otherwise midl.exe fails with an error.

The proposed solution: Provide a build directive that allows MIDL parameters to be customized in the CompileIdls task, e.g.:

namespace MetadataTasks
{
    public class CompileIdls : Task
    {
< snip >
        public string MidlSwitches
        {
            get; set;
        }
@mikebattista mikebattista added the enhancement New feature or request label Jan 13, 2023
@mikebattista mikebattista self-assigned this Jan 13, 2023
@BenJKuhn
Copy link
Member

I only have a cursory understanding of TLBs. For our purposes, is there any reason we can't just always pass /notlb? Are there IDLs that require that we generate them? Allowing customization seems like a reasonable plan either way.

@mikebattista
Copy link
Contributor

See #1432 (comment) for PR and comment on changing the default.

mikebattista added a commit that referenced this issue Jan 30, 2023
* Added MidlSwitches for #1428.

* Added MidlSwitches to CompileIdls Task.

* Set /notlb by default.
@mikebattista
Copy link
Contributor

We set /notlb by default now with the above commit. I also added a MidlSwitches property to allow adding additional parameters to see if that will be useful for other scenarios.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants