aboutsummaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2013-08-26 14:43:19 +0000
committerDouglas Gregor <dgregor@apple.com>2013-08-26 14:43:19 +0000
commitb51439594a3ec4db3155a129b0ec353d019bdd27 (patch)
tree8ae68bae3b82a39922110d14dc94b4126acfcdfa /cmake
parent92bfb547700550fcdb668862533e4952a8d74969 (diff)
downloadexternal_llvm-b51439594a3ec4db3155a129b0ec353d019bdd27.zip
external_llvm-b51439594a3ec4db3155a129b0ec353d019bdd27.tar.gz
external_llvm-b51439594a3ec4db3155a129b0ec353d019bdd27.tar.bz2
CMake Xcode builds: symlink tblgen targets out to bin/.
Xcode always puts executable targets in the directory bin/<Config>. When building separate LLVM and Clang projects for Xcode, this prevents the CMake-configured project for Clang from finding llvm-tblgen. Add a symlink so that tblgen executables are always available in bin/ (regardless of the configuration LLVM is built with). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189220 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake')
-rw-r--r--cmake/modules/TableGen.cmake10
1 files changed, 10 insertions, 0 deletions
diff --git a/cmake/modules/TableGen.cmake b/cmake/modules/TableGen.cmake
index 13a7568..d315a42 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.")