[PATCH] [CMake] Resurrect add_dependencies() and target_link_libraries()

Rafael EspĂ­ndola rafael.espindola at gmail.com
Thu Feb 27 19:11:21 PST 2014


On 27 February 2014 21:52, NAKAMURA Takumi <geek4civic at gmail.com> wrote:
> 2014-02-28 11:39 GMT+09:00 Rafael EspĂ­ndola <rafael.espindola at gmail.com>:
>> This will always use INTERFACE. The current setup has logic for
>> deciding between INTERFACE, PUBLIC and PRIVATE. Wont this produce the
>> wrong result when doing shared builds?
>
> I guess this patch would make it non-extensible. But I don't care about it.

I do :-)
In particular I care about being able to set the correct, as close to
minimal as practical, dependencies for shared and static builds.

>> What I had in mind was defining a LLVM_LINK_TYPE that is INTERFACE,
>> PUBLIC or PRIVATE depending on the build type. Is that possible?
>
> I think link type would depend on relationship between linker and linkee.
> Each library might be STATIC or SHARED.
> (This was one of reasons why I took target_link_libraries under control)

If that is what it takes to be able to compute it, I think we should
keep it, but maybe we can still get the flexibility while using the
more familiar target_link_libraries.

>> I was looking at AddLLVM.cmake, but I don't quite understand it. For
>> example, where is ARG_MODULE set?
>
> ARG_XXX is set by cmake_parse_arguments(ARG ...).

OK. Maybe we could define

LLVM_LINK_TYPE_SHARED
LLVM_LINK_TYPE_STATIC
LLVM_LINK_TYPE_DEFAULT (based on BUILD_SHARED_LIBS).

Would that work?

Cheers,
Rafael




More information about the cfe-commits mailing list