LEVEL = ../..
-LINK_COMPONENTS := all
-
include $(LEVEL)/Makefile.common
PROJ_cmake := $(DESTDIR)$(PROJ_prefix)/share/llvm/cmake
LLVM_ENABLE_RTTI := 0
endif
-# Don't try to run llvm-config during clean because it won't be available
-ifneq ($(MAKECMDGOALS),clean)
-LLVM_LIBS_TO_EXPORT := $(subst -l,,$(shell $(LLVM_CONFIG) --libs $(LINK_COMPONENTS) || echo Error))
-
-ifeq ($(LLVM_LIBS_TO_EXPORT),Error)
-$(error llvm-config --libs failed)
-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.
-# FIXME: If we used llvm-config from the install tree this wouldn't be
-# necessary.
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
-endif
OBJMODS := LLVMConfig.cmake LLVMConfigVersion.cmake LLVMExports.cmake
f.close()
- def write_make_fragment(self, output_path):
+ def write_make_fragment(self, output_path, enabled_optional_components):
"""
write_make_fragment(output_path) -> None
f.write("%s:\n" % (mk_quote_string_for_target(dep),))
f.write('endif\n')
+ f.write("""
+# List of libraries to be exported for use by applications.
+# See 'cmake/modules/Makefile'.
+LLVM_LIBS_TO_EXPORT :=""")
+ self.foreach_cmake_library(
+ lambda ci:
+ f.write(' \\\n %s' % ci.get_prefixed_library_name())
+ ,
+ enabled_optional_components,
+ skip_disabled = True
+ )
+ f.write('\n')
+
f.close()
def add_magic_target_components(parser, project, opts):
# Write out the make fragment, if requested.
if opts.write_make_fragment:
- project_info.write_make_fragment(opts.write_make_fragment)
+ project_info.write_make_fragment(opts.write_make_fragment,
+ opts.optional_components)
# Write out the cmake fragment, if requested.
if opts.write_cmake_fragment: