[Lldb-commits] [lldb] cc76965 - [MinGW] Use lib prefix for libraries

Martin Storsjö via lldb-commits lldb-commits at lists.llvm.org
Sat Sep 12 12:05:42 PDT 2020


Author: Mateusz Mikuła
Date: 2020-09-12T22:01:29+03:00
New Revision: cc76965b19085519278bff1052059e03769b71e8

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

LOG: [MinGW] Use lib prefix for libraries

In MinGW world, UNIX like lib prefix is preferred for the libraries.
This patch adjusts CMake files to do that.

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

Added: 
    

Modified: 
    clang/tools/libclang/CMakeLists.txt
    lldb/source/API/CMakeLists.txt
    llvm/cmake/modules/AddLLVM.cmake
    llvm/tools/llvm-config/llvm-config.cpp

Removed: 
    


################################################################################
diff  --git a/clang/tools/libclang/CMakeLists.txt b/clang/tools/libclang/CMakeLists.txt
index c3b9ab6ffb9b..88279ff7dae6 100644
--- a/clang/tools/libclang/CMakeLists.txt
+++ b/clang/tools/libclang/CMakeLists.txt
@@ -101,7 +101,7 @@ if (WIN32 AND ENABLE_SHARED AND ENABLE_STATIC)
   unset(ENABLE_STATIC)
 endif()
 
-if(WIN32)
+if(MSVC)
   set(output_name "libclang")
 else()
   set(output_name "clang")

diff  --git a/lldb/source/API/CMakeLists.txt b/lldb/source/API/CMakeLists.txt
index 8a7f28c01a9c..aeb1f15e294b 100644
--- a/lldb/source/API/CMakeLists.txt
+++ b/lldb/source/API/CMakeLists.txt
@@ -182,10 +182,10 @@ if (NOT CMAKE_SYSTEM_NAME MATCHES "Windows")
   set_target_properties(liblldb_exports PROPERTIES FOLDER "lldb misc")
 endif()
 
-if ( CMAKE_SYSTEM_NAME MATCHES "Windows" )
+if (MSVC)
   # Only MSVC has the ABI compatibility problem and avoids using FindPythonLibs,
   # so only it needs to explicitly link against ${Python3_LIBRARIES}
-  if (MSVC AND LLDB_ENABLE_PYTHON)
+  if (LLDB_ENABLE_PYTHON)
     target_link_libraries(liblldb PRIVATE ${Python3_LIBRARIES})
   endif()
 else()

diff  --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake
index a40cf17426fe..e57abea42753 100644
--- a/llvm/cmake/modules/AddLLVM.cmake
+++ b/llvm/cmake/modules/AddLLVM.cmake
@@ -567,7 +567,7 @@ function(llvm_add_library name)
   endif()
 
   if(ARG_SHARED)
-    if(WIN32)
+    if(MSVC)
       set_target_properties(${name} PROPERTIES
         PREFIX ""
         )

diff  --git a/llvm/tools/llvm-config/llvm-config.cpp b/llvm/tools/llvm-config/llvm-config.cpp
index a9d3f64aaa5b..1a2f04552d13 100644
--- a/llvm/tools/llvm-config/llvm-config.cpp
+++ b/llvm/tools/llvm-config/llvm-config.cpp
@@ -381,6 +381,7 @@ int main(int argc, char **argv) {
     SharedExt = "dll";
     SharedVersionedExt = LLVM_DYLIB_VERSION ".dll";
     if (HostTriple.isOSCygMing()) {
+      SharedPrefix = "lib";
       StaticExt = "a";
       StaticPrefix = "lib";
     } else {


        


More information about the lldb-commits mailing list