diff options
author | Dan Liew <dan@su-root.co.uk> | 2015-08-21 18:10:57 +0000 |
---|---|---|
committer | Dan Liew <dan@su-root.co.uk> | 2015-08-21 18:10:57 +0000 |
commit | 1e3dc527ea6d548bd776896d6fe73a91754d762e (patch) | |
tree | 9f4ec6c0acef18f0ccfd76e799653a1251380262 | |
parent | ef1fa56c83567263a801a04f9a822f761fb0a6a2 (diff) | |
download | bcm5719-llvm-1e3dc527ea6d548bd776896d6fe73a91754d762e.tar.gz bcm5719-llvm-1e3dc527ea6d548bd776896d6fe73a91754d762e.zip |
Filter libraries that are not installed out of CMake exports (currently
gtest and gtest_main) when generating ``Makefile.llvmbuild``.
Libraries that are not installed should not be exported because they
won't be available from an install tree. Rather than filtering out the
gtest libraries in cmake/modules/Makefile, simply teach llvm-build to
filter out libraries that will not be installed from its generated list
of exported libraries.
Note that LLVMBUILD_LIB_DEPS_* are used during our own CMake build
process so we cannot filter LLVMBUILD_LIB_DEPS_gtest* out in llvm-build.
We must leave this gtest filter logic in cmake/modules/Makefile.
llvm-svn: 245718
-rw-r--r-- | llvm/cmake/modules/Makefile | 6 | ||||
-rw-r--r-- | llvm/utils/llvm-build/llvmbuild/main.py | 17 |
2 files changed, 13 insertions, 10 deletions
diff --git a/llvm/cmake/modules/Makefile b/llvm/cmake/modules/Makefile index fb375b1ead5..abfda93b210 100644 --- a/llvm/cmake/modules/Makefile +++ b/llvm/cmake/modules/Makefile @@ -37,10 +37,6 @@ else LLVM_ENABLE_RTTI := 0 endif -# Strip out gtest and gtest_main from LLVM_LIBS_TO_EXPORT, these are not -# installed and won't be available from the install tree. -LLVM_LIBS_TO_EXPORT := $(filter-out gtest gtest_main,$(LLVM_LIBS_TO_EXPORT)) - ifndef LLVM_LIBS_TO_EXPORT $(error LLVM_LIBS_TO_EXPORT cannot be empty) endif @@ -122,7 +118,7 @@ $(PROJ_OBJ_DIR)/LLVMExports.cmake: $(LLVMBuildCMakeExportsFrag) Makefile done && \ cat "$(LLVMBuildCMakeExportsFrag)" && \ echo 'set_property(TARGET LLVMSupport APPEND PROPERTY IMPORTED_LINK_INTERFACE_LIBRARIES '"$(subst -l,,$(LIBS))"')' \ - ) | grep -v gtest > $@ + ) > $@ all-local:: $(addprefix $(PROJ_OBJ_DIR)/, $(OBJMODS)) diff --git a/llvm/utils/llvm-build/llvmbuild/main.py b/llvm/utils/llvm-build/llvmbuild/main.py index 6a2da754c3b..78bd7967ad0 100644 --- a/llvm/utils/llvm-build/llvmbuild/main.py +++ b/llvm/utils/llvm-build/llvmbuild/main.py @@ -503,7 +503,8 @@ subdirectories = %s def foreach_cmake_library(self, f, enabled_optional_components, - skip_disabled): + skip_disabled, + skip_not_installed): for ci in self.ordered_component_infos: # Skip optional components which are not enabled. if ci.type_name == 'OptionalLibrary' \ @@ -520,6 +521,10 @@ subdirectories = %s if tg and not tg.enabled: continue + # Skip targets that will not be installed + if skip_not_installed and not ci.installed: + continue + f(ci) @@ -600,7 +605,8 @@ set_property(GLOBAL PROPERTY LLVMBUILD_LIB_DEPS_%s %s)\n""" % ( for dep in self.get_required_libraries_for_component(ci))))) , enabled_optional_components, - skip_disabled = False + skip_disabled = False, + skip_not_installed = False # Dependency info must be emitted for internals libs too ) f.close() @@ -635,7 +641,8 @@ set_property(TARGET %s PROPERTY IMPORTED_LINK_INTERFACE_LIBRARIES %s)\n""" % ( for dep in self.get_required_libraries_for_component(ci))))) , enabled_optional_components, - skip_disabled = True + skip_disabled = True, + skip_not_installed = True # Do not export internal libraries like gtest ) f.close() @@ -715,10 +722,10 @@ LLVM_LIBS_TO_EXPORT :=""") f.write(' \\\n %s' % ci.get_prefixed_library_name()) , enabled_optional_components, - skip_disabled = True + skip_disabled = True, + skip_not_installed = True # Do not export internal libraries like gtest ) f.write('\n') - f.close() def add_magic_target_components(parser, project, opts): |