[cfe-dev] Clang 3.5 Release Pre-Pre-Pre-Announcement

Kim Gräsman kim.grasman at gmail.com
Tue Jun 3 12:54:54 PDT 2014


Hans,

Thanks for the prompt response!

On Tue, Jun 3, 2014 at 8:00 PM, Hans Wennborg <hans at chromium.org> wrote:
>
> Yes, we do this to avoid shipping the redistributable with the
> toolchain. Can you set USE_CRT_RELEASE =MT in your standalone build?
> That's what I use to build with /MT.

Once I explicitly wire up the CMake module search path to
%PROGRAMFILES%/LLVM/share/llvm/cmake and include(HandleLLVMOptions),
then yes!

I just do:

  set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${LLVM_PATH}/share/llvm/cmake)

  set(LLVM_USE_CRT_RELEASE MT)
  include(HandleLLVMOptions)

and CMake picks up that I want to use /MT over /MD. Excellent, thanks!

> No, the snapshots are built with VS2012, but we made MinGW the default
> target because it had the most complete support. Note that clang-cl
> always targets windows-msvc.

Ah, I see.

>> Unfortunately, this
>> shortcircuits all default include paths. Is there a way for me to
>> override the default triple from the build system?
>
> Does setting LLVM_DEFAULT_TARGET_TRIPLE=i686-pc-mingw32 work?

Assuming you mean "i686-pc-windows-msvc", then no, unfortunately not. I added

  set(LLVM_DEFAULT_TARGET_TRIPLE "i686-pc-windows-msvc")

and/or

  set(LLVM_DEFAULT_TARGET_TRIPLE i686-pc-windows-msvc)

before including HandleLLVMOptions, but neither had any effect on my
tool's default triple.

I'm assuming this is because the Clang/LLVM libraries are already
built with the MinGW triple and my tool doesn't explicitly override
the default triple.

Can I have my out-of-tree build derive the triple from the environment
like the in-tree build does, and push it into my tool via -D, for
example, and then let the tool explicitly set the default?

Thanks for your help,
- Kim



More information about the cfe-dev mailing list