[cfe-dev] Windows .exe from clang + COFF w/o gcc - success with issues

Michael Spencer bigcheesegs at gmail.com
Tue Aug 17 14:29:18 PDT 2010


On Tue, Aug 17, 2010 at 3:06 PM, Francois Pichet <pichet2000 at gmail.com> wrote:
> The problem is how do we deal with predefined macros that depend on
> cl.exe specific compiler switches? Almost all MSVC predefined macros
> fit this category.
>
> What I am planning to do is to write a cl2clang driver that would act
> as a cl.exe (MSVC) drop-in replacement. That driver would accept the
> same set of options as cl.exe
> (http://msdn.microsoft.com/en-us/library/fwkeyyhe%28VS.71%29.aspx).
> Translate those options (including setting predefined macros with -D)
> to be clang compatible and spawn a new clang process.
>
> Since  Visual studio 2010 is now using msbuild to build C++ projects,
> I think it would be possible to do something like:
> msbuild /p:VCBuildToolPath=cl2lang.exe mysolution.sln
>
> And use the whole MSVC build system and just have clang do the compilation.
>
> Anybody think it would be useful to put that new cl2lang driver into
> the mainline repository?
> It is just an idea for now.. I haven't started working on it.

Why not just add the cl.exe switches to clang? Try parsing anything
beginning with / as an option, and if that fails treat it like a path
to a file.

- Michael Spencer




More information about the cfe-dev mailing list