X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=cmake%2Fmodules%2FLLVM-Config.cmake;h=aa68b40076025712018c4d57e8eaecee68e7119a;hb=813f44a29fd0fd140127023222d0633e23783bcc;hp=22ac71451917a21d0703b4b828ba7a5900cf216d;hpb=e6308656a66a33de70168acf500e10d4945c0e38;p=oota-llvm.git diff --git a/cmake/modules/LLVM-Config.cmake b/cmake/modules/LLVM-Config.cmake index 22ac7145191..aa68b400760 100644 --- a/cmake/modules/LLVM-Config.cmake +++ b/cmake/modules/LLVM-Config.cmake @@ -31,7 +31,23 @@ endfunction(is_llvm_target_library) macro(llvm_config executable) - explicit_llvm_config(${executable} ${ARGN}) + cmake_parse_arguments(ARG "USE_SHARED" "" "" ${ARGN}) + set(link_components ${ARG_UNPARSED_ARGUMENTS}) + + if(USE_SHARED) + # If USE_SHARED is specified, then we link against libLLVM, + # but also against the component libraries below. This is + # done in case libLLVM does not contain all of the components + # the target requires. + # + # TODO strip LLVM_DYLIB_COMPONENTS out of link_components. + # To do this, we need special handling for "all", since that + # may imply linking to libraries that are not included in + # libLLVM. + target_link_libraries(${executable} LLVM) + endif() + + explicit_llvm_config(${executable} ${link_components}) endmacro(llvm_config)