summaryrefslogtreecommitdiff
path: root/cmake/modules/LLVMConfig.cmake
diff options
context:
space:
mode:
authorOscar Fuentes <ofv@wanadoo.es>2009-08-14 16:59:41 +0000
committerOscar Fuentes <ofv@wanadoo.es>2009-08-14 16:59:41 +0000
commit94d38e561b5985390c075abd0eaf4a7caa25b005 (patch)
tree779e7560cbf65e1cc5e08bca7b1499e77c585e71 /cmake/modules/LLVMConfig.cmake
parent717f1dcfac996b2ab6eb34754519392a907478af (diff)
downloadllvm-94d38e561b5985390c075abd0eaf4a7caa25b005.tar.gz
llvm-94d38e561b5985390c075abd0eaf4a7caa25b005.tar.bz2
llvm-94d38e561b5985390c075abd0eaf4a7caa25b005.tar.xz
CMake: Automatic regeneration of the library dependencies file.
It doesn't stop or reconfigure the build, though, so the user will see a broken build that magically succeeds at the next attempt. It is technically possible to halt the build with a helpful message, and even to automatically restart the build using the new dependencies as it we did when llvm-config was used by cmake for learning dependencies. This is left on the TODO list. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79004 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake/modules/LLVMConfig.cmake')
-rwxr-xr-xcmake/modules/LLVMConfig.cmake28
1 files changed, 26 insertions, 2 deletions
diff --git a/cmake/modules/LLVMConfig.cmake b/cmake/modules/LLVMConfig.cmake
index 4a05e32b2a..1d8d090986 100755
--- a/cmake/modules/LLVMConfig.cmake
+++ b/cmake/modules/LLVMConfig.cmake
@@ -1,5 +1,3 @@
-include(LLVMLibDeps)
-
function(get_system_libs return_var)
# Returns in `return_var' a list of system libraries used by LLVM.
if( NOT MSVC )
@@ -101,3 +99,29 @@ function(explicit_map_components_to_libraries out_libs)
endwhile( 0 LESS ${lst_size} )
set(${out_libs} ${result} PARENT_SCOPE)
endfunction(explicit_map_components_to_libraries)
+
+
+# The library dependency data is contained in the file
+# LLVMLibDeps.cmake on this directory. It is automatically generated
+# by tools/llvm-config/CMakeLists.txt when the build comprises all the
+# targets and we are on a environment Posix enough to build the
+# llvm-config script. This, in practice, just excludes MSVC.
+
+# When you remove or rename a library from the build, be sure to
+# remove its file from lib/ as well, or the GenLibDeps.pl script will
+# include it on its analysis!
+
+# The format generated by GenLibDeps.pl
+
+# LLVMARMAsmPrinter.o: LLVMARMCodeGen.o libLLVMAsmPrinter.a libLLVMCodeGen.a libLLVMCore.a libLLVMSupport.a libLLVMTarget.a
+
+# is translated to:
+
+# set(MSVC_LIB_DEPS_LLVMARMAsmPrinter LLVMARMCodeGen LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMSupport LLVMTarget)
+
+# It is necessary to remove the `lib' prefix and the `.a'.
+
+# This 'sed' script should do the trick:
+# sed -e s'#\.a##g' -e 's#libLLVM#LLVM#g' -e 's#: # #' -e 's#\(.*\)#set(MSVC_LIB_DEPS_\1)#' ~/llvm/tools/llvm-config/LibDeps.txt
+
+include(LLVMLibDeps)