diff options
| author | Oscar Fuentes <ofv@wanadoo.es> | 2010-10-17 16:10:32 +0000 |
|---|---|---|
| committer | Oscar Fuentes <ofv@wanadoo.es> | 2010-10-17 16:10:32 +0000 |
| commit | 95b6f045f1f104b96d443c404755c2757b6f6cf7 (patch) | |
| tree | 575305906a3637394a1d8bfe2006203fa0079f61 /clang/tools/driver/clang_symlink.cmake | |
| parent | a8a9f3c52be9d3c1db3d9e98a41b5270239356c1 (diff) | |
| download | bcm5719-llvm-95b6f045f1f104b96d443c404755c2757b6f6cf7.tar.gz bcm5719-llvm-95b6f045f1f104b96d443c404755c2757b6f6cf7.zip | |
Use a script for creating the clang++ executable.
The previous method used the DESTDIR environment variable at configure
time, but sometimes it is only available at install time. See PR8397.
llvm-svn: 116689
Diffstat (limited to 'clang/tools/driver/clang_symlink.cmake')
| -rw-r--r-- | clang/tools/driver/clang_symlink.cmake | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/clang/tools/driver/clang_symlink.cmake b/clang/tools/driver/clang_symlink.cmake new file mode 100644 index 00000000000..d3f11d313ef --- /dev/null +++ b/clang/tools/driver/clang_symlink.cmake @@ -0,0 +1,18 @@ +# We need to execute this script at installation time because the +# DESTDIR environment variable may be unset at configuration time. +# See PR8397. + +if(UNIX) + set(CLANGXX_LINK_OR_COPY create_symlink) + set(CLANGXX_DESTDIR $ENV{DESTDIR}) +else() + set(CLANGXX_LINK_OR_COPY copy) +endif() + +set(bindir "${CLANGXX_DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/") +set(clang "${bindir}clang${CMAKE_EXECUTABLE_SUFFIX}") +set(clangxx "${bindir}clang++${CMAKE_EXECUTABLE_SUFFIX}") + +message("Creating clang++ executable based on ${clang}") + +execute_process(COMMAND "${CMAKE_COMMAND}" -E ${CLANGXX_LINK_OR_COPY} "${clang}" "${clangxx}") |

