[LLVMdev] msbuild and clang

Reid Kleckner rnk at google.com
Mon Jun 8 12:44:31 PDT 2015


On Mon, Jun 8, 2015 at 11:55 AM, Hans Wennborg <hans at chromium.org> wrote:

> On Mon, Jun 8, 2015 at 11:44 AM, Russell Wallace
> <russell.wallace at gmail.com> wrote:
> > I'm trying to compile some large programs with clang on Windows (with a
> view
> > to compiling to bit code and then running some whole program
> optimisations
> > on the bit code).
> >
> > Take for example the Python 2.7 interpreter:
> >
> > As is typically the case, the usual build procedure involves running
> msbuild
> > which invokes the Microsoft compiler.
> >
> > The most obvious procedure would then be to substitute clang-cl.exe for
> > cl.exe and thereby take advantage of msbuild supplying correct flags,
> > include paths et cetera.
> >
> > What's the recommended procedure for this - rename clang-cl.exe to cl.exe
> > and put it earlier in your path?
>
> Yes, that's how Clang's Visual Studio integration currently works.
>
> > clang-cl requires some extra flags to get it to generate bit code
> instead of
> > object files - what's the recommended way to get that when msbuild
> doesn't
> > by default supply such flags?
>
> I'm not that familiar with msbuild, but in Visual Studio you can add
> extra flags for your project under Configuration Properties -> C/C++
> -> Command Line.


If you are feeling particularly evil and hackish, you can use the
undocumented CCC_OVERRIDE_OPTIONS environment variable:
http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/driver/driver.cpp?view=markup#l98

Ultimately, you need to get -emit-llvm-bc down to clang -cc1. You'll
probably need to play with -Xclang to make that happen.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150608/7d6c643f/attachment.html>


More information about the llvm-dev mailing list