X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=cmake%2Fmodules%2FTableGen.cmake;h=f1ddcd49a58301abf53280a6a518491095ad62b6;hb=06fdb3019671e94780d23f8e9446875253f23060;hp=97e272b04a5c712455d4f82f5032f7539ae2d239;hpb=eb3bc0ba5fae174160ef3822bb5c1fa9e093d410;p=oota-llvm.git diff --git a/cmake/modules/TableGen.cmake b/cmake/modules/TableGen.cmake index 97e272b04a5..f1ddcd49a58 100644 --- a/cmake/modules/TableGen.cmake +++ b/cmake/modules/TableGen.cmake @@ -73,7 +73,17 @@ endfunction() macro(add_tablegen target project) set(${target}_OLD_LLVM_LINK_COMPONENTS ${LLVM_LINK_COMPONENTS}) set(LLVM_LINK_COMPONENTS ${LLVM_LINK_COMPONENTS} TableGen) - add_llvm_utility(${target} ${ARGN}) + + # FIXME: It leaks to user, callee of add_tablegen. + set(LLVM_ENABLE_OBJLIB ON) + + add_llvm_utility( + ${target} ${ARGN} + # libLLVM does not include the TableGen + # components, so we cannot link any tblgen + # utilities against it. + DISABLE_LLVM_LINK_LLVM_DYLIB) + set(LLVM_LINK_COMPONENTS ${${target}_OLD_LLVM_LINK_COMPONENTS}) set(${project}_TABLEGEN "${target}" CACHE @@ -94,7 +104,11 @@ macro(add_tablegen target project) if(LLVM_USE_HOST_TOOLS) if( ${${project}_TABLEGEN} STREQUAL "${target}" ) - set(${project}_TABLEGEN_EXE "${LLVM_NATIVE_BUILD}/bin/${target}") + if (NOT CMAKE_CONFIGURATION_TYPES) + set(${project}_TABLEGEN_EXE "${LLVM_NATIVE_BUILD}/bin/${target}") + else() + set(${project}_TABLEGEN_EXE "${LLVM_NATIVE_BUILD}/Release/bin/${target}") + endif() set(${project}_TABLEGEN_EXE ${${project}_TABLEGEN_EXE} PARENT_SCOPE) add_custom_command(OUTPUT ${${project}_TABLEGEN_EXE}