X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=cmake%2Fmodules%2FLLVM-Config.cmake;h=2ddc0b2bf89a34c14dc06cc77063f80e7aab89f5;hb=71857ccdb83b6374f7a791c2dae45ce9934a85af;hp=a6286fee6856402d01ca7d3a238dd45a2b494cd3;hpb=7a2bdde0a0eebcd2125055e0eacaca040f0b766c;p=oota-llvm.git diff --git a/cmake/modules/LLVM-Config.cmake b/cmake/modules/LLVM-Config.cmake old mode 100755 new mode 100644 index a6286fee685..2ddc0b2bf89 --- a/cmake/modules/LLVM-Config.cmake +++ b/cmake/modules/LLVM-Config.cmake @@ -4,11 +4,17 @@ function(get_system_libs return_var) if( MINGW ) set(system_libs ${system_libs} imagehlp psapi) elseif( CMAKE_HOST_UNIX ) + if( HAVE_LIBRT ) + set(system_libs ${system_libs} rt) + endif() if( HAVE_LIBDL ) - set(system_libs ${system_libs} ${CMAKE_DL_LIBS}) + set(system_libs ${system_libs} ${CMAKE_DL_LIBS}) endif() if( LLVM_ENABLE_THREADS AND HAVE_LIBPTHREAD ) - set(system_libs ${system_libs} pthread) + set(system_libs ${system_libs} pthread) + endif() + if ( LLVM_ENABLE_ZLIB AND HAVE_LIBZ ) + set(system_libs ${system_libs} z) endif() endif( MINGW ) endif( NOT MSVC ) @@ -135,14 +141,14 @@ function(explicit_map_components_to_libraries out_libs) string(TOUPPER "${c}" capitalized) list(FIND capitalized_libs LLVM${capitalized} lib_idx) if( lib_idx LESS 0 ) - # The component is unknown. Maybe is an omitted target? - is_llvm_target_library(${c} iltl_result) - if( NOT iltl_result ) - message(FATAL_ERROR "Library `${c}' not found in list of llvm libraries.") - endif() + # The component is unknown. Maybe is an omitted target? + is_llvm_target_library(${c} iltl_result) + if( NOT iltl_result ) + message(FATAL_ERROR "Library `${c}' not found in list of llvm libraries.") + endif() else( lib_idx LESS 0 ) - list(GET llvm_libs ${lib_idx} canonical_lib) - list(APPEND expanded_components ${canonical_lib}) + list(GET llvm_libs ${lib_idx} canonical_lib) + list(APPEND expanded_components ${canonical_lib}) endif( lib_idx LESS 0 ) endif( NOT idx LESS 0 ) endforeach(c) @@ -152,7 +158,8 @@ function(explicit_map_components_to_libraries out_libs) set(processed) while( cursor LESS lst_size ) list(GET expanded_components ${cursor} lib) - list(APPEND expanded_components ${MSVC_LIB_DEPS_${lib}}) + get_property(lib_deps GLOBAL PROPERTY LLVMBUILD_LIB_DEPS_${lib}) + list(APPEND expanded_components ${lib_deps}) # Remove duplicates at the front: list(REVERSE expanded_components) list(REMOVE_DUPLICATES expanded_components) @@ -175,29 +182,3 @@ function(explicit_map_components_to_libraries out_libs) endforeach(c) 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)