[llvm-commits] [llvm] r113676 - in /llvm/trunk: CMakeLists.txt cmake/modules/AddLLVM.cmake

Michael J. Spencer bigcheesegs at gmail.com
Fri Sep 10 19:13:39 PDT 2010


Author: mspencer
Date: Fri Sep 10 21:13:39 2010
New Revision: 113676

URL: http://llvm.org/viewvc/llvm-project?rev=113676&view=rev
Log:
CMake: Fix mingw32 build.

Modified:
    llvm/trunk/CMakeLists.txt
    llvm/trunk/cmake/modules/AddLLVM.cmake

Modified: llvm/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/CMakeLists.txt?rev=113676&r1=113675&r2=113676&view=diff
==============================================================================
--- llvm/trunk/CMakeLists.txt (original)
+++ llvm/trunk/CMakeLists.txt Fri Sep 10 21:13:39 2010
@@ -258,6 +258,15 @@
 include(AddLLVM)
 include(TableGen)
 
+if( MINGW )
+  get_system_libs(LLVM_SYSTEM_LIBS_LIST)
+  foreach(l ${LLVM_SYSTEM_LIBS_LIST})
+    set(LLVM_SYSTEM_LIBS "${LLVM_SYSTEM_LIBS} -l${l}")
+  endforeach()
+  set(CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIBRARIES}${LLVM_SYSTEM_LIBS}")
+  set(CMAKE_C_STANDARD_LIBRARIES "${CMAKE_C_STANDARD_LIBRARIES}${LLVM_SYSTEM_LIBS}")
+endif()
+
 add_subdirectory(lib/Support)
 add_subdirectory(lib/System)
 

Modified: llvm/trunk/cmake/modules/AddLLVM.cmake
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/AddLLVM.cmake?rev=113676&r1=113675&r2=113676&view=diff
==============================================================================
--- llvm/trunk/cmake/modules/AddLLVM.cmake (original)
+++ llvm/trunk/cmake/modules/AddLLVM.cmake Fri Sep 10 21:13:39 2010
@@ -78,16 +78,18 @@
       target_link_libraries( ${name} ${lib} )
     endforeach(lib)
   endif( LLVM_USED_LIBS )
-  get_system_libs(llvm_system_libs)
-  if( llvm_system_libs )
-    target_link_libraries(${name} ${llvm_system_libs})
-  endif()
   if( LLVM_COMMON_DEPENDS )
     add_dependencies( ${name} ${LLVM_COMMON_DEPENDS} )
   endif( LLVM_COMMON_DEPENDS )
   if (LLVM_COMMON_LIBS)
     target_link_libraries(${name} ${LLVM_COMMON_LIBS})
   endif()
+  if( NOT MINGW )
+    get_system_libs(llvm_system_libs)
+    if( llvm_system_libs )
+      target_link_libraries(${name} ${llvm_system_libs})
+    endif()
+  endif()
 endmacro(add_llvm_executable name)
 
 





More information about the llvm-commits mailing list