[PATCH] Do not export gtest library targets or install them for CMake and do not export for Autoconf/Makefile install

Dan Liew dan at su-root.co.uk
Fri Jun 26 17:13:22 PDT 2015


Hi,

This patch addresses bug 23967 [1]. The problem is that

- the CMake build of LLVM installs and exports the gtest library
targets. We should not being doing this, these are not part of LLVM.
- the Autoconf/Makefile build of LLVM still has gtest libraries in the
installed LLVMConfig.cmake.

I found this because if I do ``llvm_map_components_to_libnames(XXX
all)`` then the variable XXX will contain ``gtest`` and
``gtest_main``. This is not desirable because a client of LLVM
probably doesn't want to link with the gtest libraries. In fact on my
system it broke the build of my project because I don't have gtest
installed.

The attached patch tries to resolve this.

Unfortunately there are still references to gtest and gtest_main in
the generated LLVMConfig.cmake when using the Autoconf/Makefile build
system.

```
set_property(GLOBAL PROPERTY LLVMBUILD_LIB_DEPS_gtest LLVMSupport)
set_property(GLOBAL PROPERTY LLVMBUILD_LIB_DEPS_gtest_main gtest)
```

However this should fix the problem I observed with
``llvm_map_components_to_libnames()``.

Could someone please review this before I commit it?

[1] https://llvm.org/bugs/show_bug.cgi?id=23967

Thanks,
Dan.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: no_export_gtest.patch
Type: text/x-patch
Size: 1513 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150626/804d6da8/attachment.bin>


More information about the llvm-commits mailing list