[llvm] 6284141 - [llvm] Added support for stand-alone cmake object libraries.

Mircea Trofin via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 24 08:19:57 PDT 2020


Author: Mircea Trofin
Date: 2020-06-24T08:18:42-07:00
New Revision: 62841415e685fe8857f75edd1fa92b7d1d08b875

URL: https://github.com/llvm/llvm-project/commit/62841415e685fe8857f75edd1fa92b7d1d08b875
DIFF: https://github.com/llvm/llvm-project/commit/62841415e685fe8857f75edd1fa92b7d1d08b875.diff

LOG: [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

Added: 
    

Modified: 
    llvm/cmake/modules/AddLLVM.cmake

Removed: 
    


################################################################################
diff  --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake
index e25c72f3cae3..7ac308c62b94 100644
--- a/llvm/cmake/modules/AddLLVM.cmake
+++ b/llvm/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


        


More information about the llvm-commits mailing list