diff options
Diffstat (limited to 'cmake/modules/TableGen.cmake')
-rw-r--r-- | cmake/modules/TableGen.cmake | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/cmake/modules/TableGen.cmake b/cmake/modules/TableGen.cmake index 7a1d4a1..c17e67e 100644 --- a/cmake/modules/TableGen.cmake +++ b/cmake/modules/TableGen.cmake @@ -85,6 +85,16 @@ macro(add_tablegen target project) add_llvm_utility(${target} ${ARGN}) set(LLVM_LINK_COMPONENTS ${${target}_OLD_LLVM_LINK_COMPONENTS}) + # For Xcode builds, symlink bin/<target> to bin/<Config>/<target> so that + # a separately-configured Clang project can still find llvm-tblgen. + if (XCODE) + add_custom_target(${target}-top ALL + ${CMAKE_COMMAND} -E create_symlink + ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/${target}${CMAKE_EXECUTABLE_SUFFIX} + ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${target}${CMAKE_EXECUTABLE_SUFFIX} + DEPENDS ${target}) + endif () + set(${project}_TABLEGEN "${target}" CACHE STRING "Native TableGen executable. Saves building one when cross-compiling.") @@ -118,7 +128,7 @@ macro(add_tablegen target project) endif() if( MINGW ) - target_link_libraries(${target} imagehlp psapi) + target_link_libraries(${target} imagehlp psapi shell32) if(CMAKE_SIZEOF_VOID_P MATCHES "8") set_target_properties(${target} PROPERTIES LINK_FLAGS -Wl,--stack,16777216) endif(CMAKE_SIZEOF_VOID_P MATCHES "8") @@ -127,5 +137,7 @@ macro(add_tablegen target project) target_link_libraries(${target} pthread) endif() - install(TARGETS ${target} RUNTIME DESTINATION bin) + if (${project} STREQUAL LLVM AND NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + install(TARGETS ${target} RUNTIME DESTINATION bin) + endif() endmacro() |