From 8eeb96d2d56f05fe6cf95a835f66c72410215be2 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Thu, 4 Jun 2009 19:53:37 +0000 Subject: CMake: Use explicit dependencies for Xcode (as well as MSVC), to make the CMake-generated Xcode project build properly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72883 91177308-0d34-0410-b5e6-96231b3b80d8 --- cmake/modules/LLVMConfig.cmake | 54 +++++++++++++++++++++++------------------- 1 file changed, 29 insertions(+), 25 deletions(-) (limited to 'cmake/modules/LLVMConfig.cmake') diff --git a/cmake/modules/LLVMConfig.cmake b/cmake/modules/LLVMConfig.cmake index 9776fb05d2..fd92495187 100755 --- a/cmake/modules/LLVMConfig.cmake +++ b/cmake/modules/LLVMConfig.cmake @@ -21,36 +21,40 @@ endfunction(get_system_libs) macro(llvm_config executable) # extra args is the list of link components. - if( MSVC ) - msvc_llvm_config(${executable} ${ARGN}) - else( MSVC ) + if( USE_EXPLICIT_DEPENDENCIES ) + explicit_llvm_config(${executable} ${ARGN}) + else( ) nix_llvm_config(${executable} ${ARGN}) - endif( MSVC ) + endif( ) endmacro(llvm_config) -function(msvc_llvm_config executable) +function(explicit_llvm_config executable) set( link_components ${ARGN} ) - if( CMAKE_CL_64 ) - set(include_lflag "/INCLUDE:") - else( CMAKE_CL_64 ) - set(include_lflag "/INCLUDE:_") - endif() - foreach(c ${link_components}) - if( c STREQUAL "jit" ) - set(lfgs "${lfgs} ${include_lflag}X86TargetMachineModule") - endif( c STREQUAL "jit" ) - list(FIND LLVM_TARGETS_TO_BUILD ${c} idx) - if( NOT idx LESS 0 ) - set(lfgs "${lfgs} ${include_lflag}${c}TargetMachineModule") - list(FIND LLVM_ASMPRINTERS_FORCE_LINK ${c} idx) + + set(lfgs) + if (MSVC) + if( CMAKE_CL_64 ) + set(include_lflag "/INCLUDE:") + else( CMAKE_CL_64 ) + set(include_lflag "/INCLUDE:_") + endif() + foreach(c ${link_components}) + if( c STREQUAL "jit" ) + set(lfgs "${lfgs} ${include_lflag}X86TargetMachineModule") + endif( c STREQUAL "jit" ) + list(FIND LLVM_TARGETS_TO_BUILD ${c} idx) if( NOT idx LESS 0 ) - set(lfgs "${lfgs} ${include_lflag}${c}AsmPrinterForceLink") + set(lfgs "${lfgs} ${include_lflag}${c}TargetMachineModule") + list(FIND LLVM_ASMPRINTERS_FORCE_LINK ${c} idx) + if( NOT idx LESS 0 ) + set(lfgs "${lfgs} ${include_lflag}${c}AsmPrinterForceLink") + endif() endif() - endif() - endforeach(c) + endforeach(c) + endif () - msvc_map_components_to_libraries(LIBRARIES ${link_components}) + explicit_map_components_to_libraries(LIBRARIES ${link_components}) target_link_libraries(${executable} ${LIBRARIES}) if( lfgs ) @@ -58,10 +62,10 @@ function(msvc_llvm_config executable) PROPERTIES LINK_FLAGS ${lfgs}) endif() -endfunction(msvc_llvm_config) +endfunction(explicit_llvm_config) -function(msvc_map_components_to_libraries out_libs) +function(explicit_map_components_to_libraries out_libs) set( link_components ${ARGN} ) foreach(c ${link_components}) # add codegen/asmprinter @@ -121,7 +125,7 @@ function(msvc_map_components_to_libraries out_libs) endwhile( ${curr_idx} LESS ${lst_size} ) list(REMOVE_DUPLICATES result) set(${out_libs} ${result} PARENT_SCOPE) -endfunction(msvc_map_components_to_libraries) +endfunction(explicit_map_components_to_libraries) macro(nix_llvm_config executable) -- cgit v1.2.3