Page MenuHomePhabricator

llvm-config: Add preliminary Windows support
ClosedPublic

Authored by ehsan on Jan 31 2016, 4:41 PM.

Details

Summary

This patch adds Windows support for a few of the llvm-config commands,
including cflags, ldflags, libs, and system-libs.

Currently llvm-config is untested, so this patch adds tests for the
commands that it fixes as well.

Diff Detail

Repository
rL LLVM

Event Timeline

ehsan updated this revision to Diff 46500.Jan 31 2016, 4:41 PM
ehsan retitled this revision from to llvm-config: Add preliminary Windows support.
ehsan updated this object.
ehsan added a reviewer: rnk.
ehsan added a subscriber: llvm-commits.
ehsan updated this revision to Diff 47043.Feb 5 2016, 2:01 PM

This fixes a couple of bugs in the previous iteration of the patch.

rnk accepted this revision.Feb 8 2016, 3:31 PM
rnk edited edge metadata.

lgtm

lib/Support/CMakeLists.txt
2–6 ↗(On Diff #47043)

Seems simpler as

if (MSVC OR MINGW)
  set(system_libs ${system_libs} psapi shell32 ole32 uuid)
elseif (CMAKE_HOST_UNIX)
  ...
This revision is now accepted and ready to land.Feb 8 2016, 3:31 PM
This revision was automatically updated to reflect the committed changes.
chapuni added a subscriber: chapuni.Feb 9 2016, 3:53 PM

Is this the direction that llvm-config emits "native" DirSep?
I suppose the primary user of llvm-config would be unix tools, like shell scripts and Make(1).

In my curiosity, who is an user to use native paths of llvm-config?

I suggest to add a flag like "--native", or "--dos", to change the behavior.

Sorry, I misunderstood that the behavior weren't just for MSVC host. It is better.
That said, I suggest to keep behavior, just for the separator, by default. (lib's prefix and sufiix should be fine)

llvm/trunk/tools/llvm-config/llvm-config.cpp
364

It confuses cross compilation, due to r252532. http://reviews.llvm.org/D13198

I will fix it later.