llvm.org GIT mirror llvm / 299db16
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245718 91177308-0d34-0410-b5e6-96231b3b80d8 Dan Liew 5 years ago
2 changed file(s) with 13 addition(s) and 10 deletion(s). Raw diff Collapse all Expand all
3535 else
3636 LLVM_ENABLE_RTTI := 0
3737 endif
38
39 # Strip out gtest and gtest_main from LLVM_LIBS_TO_EXPORT, these are not
40 # installed and won't be available from the install tree.
41 LLVM_LIBS_TO_EXPORT := $(filter-out gtest gtest_main,$(LLVM_LIBS_TO_EXPORT))
4238
4339 ifndef LLVM_LIBS_TO_EXPORT
4440 $(error LLVM_LIBS_TO_EXPORT cannot be empty)
121117 done && \
122118 cat "$(LLVMBuildCMakeExportsFrag)" && \
123119 echo 'set_property(TARGET LLVMSupport APPEND PROPERTY IMPORTED_LINK_INTERFACE_LIBRARIES '"$(subst -l,,$(LIBS))"')' \
124 ) | grep -v gtest > $@
120 ) > $@
125121
126122 all-local:: $(addprefix $(PROJ_OBJ_DIR)/, $(OBJMODS))
127123
502502
503503 def foreach_cmake_library(self, f,
504504 enabled_optional_components,
505 skip_disabled):
505 skip_disabled,
506 skip_not_installed):
506507 for ci in self.ordered_component_infos:
507508 # Skip optional components which are not enabled.
508509 if ci.type_name == 'OptionalLibrary' \
518519 tg = ci.get_parent_target_group()
519520 if tg and not tg.enabled:
520521 continue
522
523 # Skip targets that will not be installed
524 if skip_not_installed and not ci.installed:
525 continue
521526
522527 f(ci)
523528
599604 for dep in self.get_required_libraries_for_component(ci)))))
600605 ,
601606 enabled_optional_components,
602 skip_disabled = False
607 skip_disabled = False,
608 skip_not_installed = False # Dependency info must be emitted for internals libs too
603609 )
604610
605611 f.close()
634640 for dep in self.get_required_libraries_for_component(ci)))))
635641 ,
636642 enabled_optional_components,
637 skip_disabled = True
643 skip_disabled = True,
644 skip_not_installed = True # Do not export internal libraries like gtest
638645 )
639646
640647 f.close()
714721 f.write(' \\\n %s' % ci.get_prefixed_library_name())
715722 ,
716723 enabled_optional_components,
717 skip_disabled = True
724 skip_disabled = True,
725 skip_not_installed = True # Do not export internal libraries like gtest
718726 )
719727 f.write('\n')
720
721728 f.close()
722729
723730 def add_magic_target_components(parser, project, opts):