]> granicus.if.org Git - clang/commitdiff
CMake mingw build fixes.
authorBenjamin Kramer <benny.kra@googlemail.com>
Sun, 11 Oct 2009 12:22:00 +0000 (12:22 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Sun, 11 Oct 2009 12:22:00 +0000 (12:22 +0000)
- llvm's libs must be linked after clang's
- libLLVMSystem depends on psapi on win32 (get_system_libs has it)
- CIndex builds successfully on mingw now

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83773 91177308-0d34-0410-b5e6-96231b3b80d8

CMakeLists.txt

index cdc2b9b8a4841ae257e83f948dfff7c0d2be03eb..0cd52d0d946b573dc6885ce456391695802be696 100644 (file)
@@ -43,14 +43,18 @@ macro(add_clang_library name)
   if( LLVM_COMMON_DEPENDS )
     add_dependencies( ${name} ${LLVM_COMMON_DEPENDS} )
   endif( LLVM_COMMON_DEPENDS )
-  if( LLVM_LINK_COMPONENTS )
-    llvm_config(${name} ${LLVM_LINK_COMPONENTS})
-  endif( LLVM_LINK_COMPONENTS )
   if( LLVM_USED_LIBS )
     foreach(lib ${LLVM_USED_LIBS})
       target_link_libraries( ${name} ${lib} )
     endforeach(lib)
   endif( LLVM_USED_LIBS )
+  if( LLVM_LINK_COMPONENTS )
+    llvm_config(${name} ${LLVM_LINK_COMPONENTS})
+  endif( LLVM_LINK_COMPONENTS )
+  get_system_libs(llvm_system_libs)
+  if( llvm_system_libs )
+    target_link_libraries(${name} ${llvm_system_libs})
+  endif( llvm_system_libs )
   add_dependencies(${name} ClangDiagnosticCommon)
   if(MSVC)
     get_target_property(cflag ${name} COMPILE_FLAGS)