[LLVMdev] msbuild and clang

Régis Portalez regis.portalez at altimesh.com
Mon Jun 8 13:31:35 PDT 2015


Msbuild provides you the exec task, which allows You to do as many thing as the command line does.

You can also write your own tasks in c# If you have some advanced requirements.

Cheers




-----Message d'origine-----
De : "Reid Kleckner" <rnk at google.com>
Envoyé : ‎08/‎06/‎2015 21:46
À : "Hans Wennborg" <hans at chromium.org>
Cc : "llvmdev at cs.uiuc.edu" <llvmdev at cs.uiuc.edu>
Objet : Re: [LLVMdev] msbuild and clang

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/97ca375d/attachment.html>


More information about the llvm-dev mailing list