From 4a9378fa56996b9de97ad7f45931641b02c3c9da Mon Sep 17 00:00:00 2001 From: Mircea Trofin Date: Tue, 9 Jun 2020 12:44:07 -0700 Subject: [PATCH] [llvm] Added support for stand-alone cmake object libraries. Summary: Currently, add_llvm_library would create an OBJECT library alongside of a STATIC / SHARED library, but losing the link interface (its elements would become dependencies instead). To support scenarios where linking an object library also brings in its usage requirements, this patch adds support for 'stand-alone' OBJECT libraries - i.e. without an accompanying SHARED/STATIC library, and maintaining the link interface defined by the user. This is useful for cases where, for example, we want to build a part of a component separately. Using a STATIC target would incur the risk that symbols not referenced in the consumer would be dropped (which may be undesirable). The current application is the ML part of Analysis. It should be part of the Analysis component, so it may reference other analyses; and (in upcoming changes) it has dependencies on optional libraries. Reviewers: karies, davidxl, beanz, phosek, smeenai Subscribers: mgorny, hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D81447 --- cmake/modules/AddLLVM.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/modules/AddLLVM.cmake b/cmake/modules/AddLLVM.cmake index e25c72f3cae..7ac308c62b9 100644 --- a/cmake/modules/AddLLVM.cmake +++ b/cmake/modules/AddLLVM.cmake @@ -891,7 +891,7 @@ endmacro(add_llvm_executable name) # only an object library is built, and no module is built. This is specific to the Polly use case. # # The SUBPROJECT argument contains the LLVM project the plugin belongs -# to. If set, the plugin will link statically by default it if the +# to. If set, the plugin will link statically by default it if the # project was enabled. function(add_llvm_pass_plugin name) cmake_parse_arguments(ARG