[llvm-branch-commits] [llvm] 499b169 - [CMake] Use PUBLIC link mode for static libraries

Hans Wennborg via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Mar 2 02:08:12 PST 2020


Author: Petr Hosek
Date: 2020-03-02T10:59:49+01:00
New Revision: 499b1699621eb0aed9bec7017c1db60ccad30ae4

URL: https://github.com/llvm/llvm-project/commit/499b1699621eb0aed9bec7017c1db60ccad30ae4
DIFF: https://github.com/llvm/llvm-project/commit/499b1699621eb0aed9bec7017c1db60ccad30ae4.diff

LOG: [CMake] Use PUBLIC link mode for static libraries

Using INTERFACE prevents the use of imported libraries as we've done
in 00b3d49 because these aren't linked against the target, they're
only made part of the interface. This doesn't affect the output since
static libraries aren't being linked into, but it enables the use of
imported libraries.

Differential Revision: https://reviews.llvm.org/D74106

(cherry picked from commit 50a6d3a6486d81d21a2c31ce8522321e19bed35e)

Added: 
    

Modified: 
    llvm/cmake/modules/AddLLVM.cmake

Removed: 
    


################################################################################
diff  --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake
index 8d674f93542c..fd69786544ac 100644
--- a/llvm/cmake/modules/AddLLVM.cmake
+++ b/llvm/cmake/modules/AddLLVM.cmake
@@ -602,7 +602,7 @@ function(llvm_add_library name)
   endif()
 
   if(ARG_STATIC)
-    set(libtype INTERFACE)
+    set(libtype PUBLIC)
   else()
     # We can use PRIVATE since SO knows its dependent libs.
     set(libtype PRIVATE)


        


More information about the llvm-branch-commits mailing list