[llvm] b22bf7e - [CMake] Add version to libLLVM also on non-UNIX

Martin Storsjö via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 23 13:06:29 PDT 2021


Author: Martin Storsjö
Date: 2021-07-23T23:05:55+03:00
New Revision: b22bf7e82ae06acb91a248c69c5fa44393d49906

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

LOG: [CMake] Add version to libLLVM also on non-UNIX

As discussed in https://reviews.llvm.org/D87521

llvm-config expects versioned library regardless of platform.

Reviewed By: mstorsjo

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

Added: 
    

Modified: 
    llvm/cmake/modules/AddLLVM.cmake

Removed: 
    


################################################################################
diff  --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake
index 000933ea3d002..1f44b7b483264 100644
--- a/llvm/cmake/modules/AddLLVM.cmake
+++ b/llvm/cmake/modules/AddLLVM.cmake
@@ -606,7 +606,7 @@ function(llvm_add_library name)
     endif()
   endif()
 
-  if(ARG_SHARED AND UNIX)
+  if(ARG_SHARED)
     if(NOT APPLE AND ARG_SONAME)
       get_target_property(output_name ${name} OUTPUT_NAME)
       if(${output_name} STREQUAL "output_name-NOTFOUND")
@@ -615,10 +615,12 @@ function(llvm_add_library name)
       set(library_name ${output_name}-${LLVM_VERSION_MAJOR}${LLVM_VERSION_SUFFIX})
       set(api_name ${output_name}-${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}${LLVM_VERSION_SUFFIX})
       set_target_properties(${name} PROPERTIES OUTPUT_NAME ${library_name})
-      llvm_install_library_symlink(${api_name} ${library_name} SHARED
-        COMPONENT ${name})
-      llvm_install_library_symlink(${output_name} ${library_name} SHARED
-        COMPONENT ${name})
+      if(UNIX)
+        llvm_install_library_symlink(${api_name} ${library_name} SHARED
+          COMPONENT ${name})
+        llvm_install_library_symlink(${output_name} ${library_name} SHARED
+          COMPONENT ${name})
+      endif()
     endif()
   endif()
 


        


More information about the llvm-commits mailing list