CMake: build llvm-config before the other tools.
authorOscar Fuentes <ofv@wanadoo.es>
Fri, 14 Aug 2009 01:55:05 +0000 (01:55 +0000)
committerOscar Fuentes <ofv@wanadoo.es>
Fri, 14 Aug 2009 01:55:05 +0000 (01:55 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78975 91177308-0d34-0410-b5e6-96231b3b80d8

tools/CMakeLists.txt
tools/llvm-config/CMakeLists.txt

index 5dcfebaa72af80aff68daec1354433904398a476..40bf6924390c6779a68254ccf75c45526be85d72 100644 (file)
@@ -3,7 +3,12 @@
 # in parallel builds.  Please retain this ordering.
 
 if( NOT MSVC )
- add_subdirectory(llvm-config)
+  # It is useful to build llvm-config before the other tools, so we
+  # have a fresh LibDeps.txt for regenerating the hard-coded library
+  # dependencies. llvm-config/CMakeLists.txt takes care of this but we
+  # must keep llvm-config as the first entry on the list of tools to
+  # be built.
+  add_subdirectory(llvm-config)
 endif()
 
 add_subdirectory(opt)
index 08074be8dcd84dd1eeebe8d372fac5ca50243037..03fe66b66866572dd97b32cb1cb2cee6789a202d 100644 (file)
@@ -113,6 +113,12 @@ add_custom_target(llvm-config.target ALL
 
 add_dependencies(llvm-config.target ${llvm_lib_targets})
 
+# Make sure that llvm-config builds before the llvm tools, so we have
+# LibDeps.txt and can use it for updating the hard-coded library
+# dependencies on cmake/modules/LLVMLibDeps.cmake when the tools'
+# build fail due to outdated dependencies:
+set(LLVM_COMMON_DEPENDS ${LLVM_COMMON_DEPENDS} llvm-config.target)
+
 install(FILES ${LLVM_CONFIG}
   PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE
   WORLD_READ WORLD_EXECUTE