[CMake] Deliberately get all LLVM library dependencies for standalone builds.
authorJordan Rose <jordan_rose@apple.com>
Wed, 5 Feb 2014 00:02:42 +0000 (00:02 +0000)
committerJordan Rose <jordan_rose@apple.com>
Wed, 5 Feb 2014 00:02:42 +0000 (00:02 +0000)
CMake won't expand the dependency graph for us if the dependencies are in
another project, which leads to link errors in the standalone build.
This is a refinement of r200765.

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

cmake/modules/LLVM-Config.cmake

index 31395649323826941113b36d8959fee6bc066528..3b0c948e6a64e161bd4aaa4f439e02edd73b42e7 100644 (file)
@@ -62,7 +62,13 @@ endmacro(llvm_config)
 function(explicit_llvm_config executable)
   set( link_components ${ARGN} )
 
-  llvm_map_components_to_libnames(LIBRARIES ${link_components})
+  # Check for out-of-tree builds.
+  if(PROJECT_NAME STREQUAL "LLVM")
+    llvm_map_components_to_libnames(LIBRARIES ${link_components})
+  else()
+    explicit_map_components_to_libraries(LIBRARIES ${link_components})
+  endif()
+
   target_link_libraries(${executable} ${LIBRARIES})
 endfunction(explicit_llvm_config)