summaryrefslogtreecommitdiffstats
path: root/llvm/utils/llvm-build
diff options
context:
space:
mode:
authorDan Liew <dan@su-root.co.uk>2015-08-21 18:10:55 +0000
committerDan Liew <dan@su-root.co.uk>2015-08-21 18:10:55 +0000
commitef1fa56c83567263a801a04f9a822f761fb0a6a2 (patch)
tree82c8fc7649034643c0528016f6e2a3376771d5a8 /llvm/utils/llvm-build
parenta70fb6e0a54cbcc063affb8f6b42b1c6a5e0844d (diff)
downloadbcm5719-llvm-ef1fa56c83567263a801a04f9a822f761fb0a6a2.tar.gz
bcm5719-llvm-ef1fa56c83567263a801a04f9a822f761fb0a6a2.zip
llvm-build: Adopt generation of LLVM_LIBS_TO_EXPORT. Patch by
Brad King. Move `LLVM_LIBS_TO_EXPORT` over to Makefile.llvmbuild and generate it from `llvm-build` using the same logic used to export the dependencies of these libraries. This avoids depending on `llvm-config`. This refactoring was originally motivated by issue #24154 due to commit r243297 (Fix `llvm-config` to emit the linker flag for the combined shared object, 2015-07-27) changing the output of `llvm-config --libs` to not have the individual libraries when we configure with `--enable-shared`. That change was reverted by r244108 but this refactoring makes sense on its own anyway. llvm-svn: 245717
Diffstat (limited to 'llvm/utils/llvm-build')
-rw-r--r--llvm/utils/llvm-build/llvmbuild/main.py18
1 files changed, 16 insertions, 2 deletions
diff --git a/llvm/utils/llvm-build/llvmbuild/main.py b/llvm/utils/llvm-build/llvmbuild/main.py
index 5742b05d4f9..6a2da754c3b 100644
--- a/llvm/utils/llvm-build/llvmbuild/main.py
+++ b/llvm/utils/llvm-build/llvmbuild/main.py
@@ -640,7 +640,7 @@ set_property(TARGET %s PROPERTY IMPORTED_LINK_INTERFACE_LIBRARIES %s)\n""" % (
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
@@ -706,6 +706,19 @@ set_property(TARGET %s PROPERTY IMPORTED_LINK_INTERFACE_LIBRARIES %s)\n""" % (
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):
@@ -929,7 +942,8 @@ given by --build-root) at the same SUBPATH""",
# 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:
OpenPOWER on IntegriCloud