https://bugs.llvm.org/show_bug.cgi?id=40140

            Bug ID: 40140
           Summary: clang-cl can't be used with midl
           Product: new-bugs
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
          Assignee: unassignedb...@nondot.org
          Reporter: mh+l...@glandium.org
                CC: htmldevelo...@gmail.com, llvm-bugs@lists.llvm.org

midl, a tool part of the Windows SDK, defaults to use cl.exe as a preprocessor.
One can override that with the /cpp_cmd flag to midl, and for people trying not
to depend on MSVC at all, it would seem like a good idea to pass clang-cl
there. But that doesn't work.

midl invokes the preprocessor with the following command line:

$preprocessor -E -D__midl=801 path/to/file.idl

with clang-cl, this fails because -E is ignored and the idl file is considered
as a linker input. So it warns about command line arguments being unused, and
gives no preprocessed output.

e.g.:

$ c:/Users/glandium/.mozbuild/clang/bin/clang-cl.exe -E -D__midl=801
c:/Users/glandium/Desktop/mozilla-unified/accessible/ipc/win/typelib/Accessible.idl
clang-cl: warning:
c:/Users/glandium/Desktop/mozilla-unified/accessible/ipc/win/typelib/Accessible.idl:
'linker' input unused [-Wunused-command-line-argument]
clang-cl: warning: argument unused during compilation: '-D __midl=801'
[-Wunused-command-line-argument]

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to