2015-09-15 07:09:06 +08:00
|
|
|
# We need to execute this script at installation time because the
|
|
|
|
# DESTDIR environment variable may be unset at configuration time.
|
|
|
|
# See PR8397.
|
|
|
|
|
2021-12-11 09:36:24 +08:00
|
|
|
include(GNUInstallDirs)
|
|
|
|
|
2015-10-17 07:17:13 +08:00
|
|
|
function(install_symlink name target outdir)
|
2019-08-15 23:36:13 +08:00
|
|
|
set(DESTDIR $ENV{DESTDIR})
|
2022-01-21 10:48:10 +08:00
|
|
|
set(bindir "${DESTDIR}${CMAKE_INSTALL_PREFIX}/${outdir}")
|
2015-09-15 07:09:06 +08:00
|
|
|
|
Specify log level for CMake messages (less stderr)
Summary:
Specify message levels in CMake. Prefer STATUS (stdout).
As the default message mode (i.e. level) is NOTICE in CMake, more then necessary messages get printed to stderr. Some tools, noticably ccmake treat this as an error and require additional confirmation and re-running CMake's configuration step.
This commit specifies a mode (either STATUS or WARNING or FATAL_ERROR) instead of the default.
* I used `csearch -f 'llvm-project/.+(CMakeLists\.txt|cmake)' -l 'message\("'` to find all locations.
* Reviewers were chosen by the most common authors of specific files. If there are more suitable reviewers for these CMake changes, please let me know.
Patch by: Christoph Siedentop
Reviewers: zturner, beanz, xiaobai, kbobyrev, lebedev.ri, sgraenitz
Reviewed By: sgraenitz
Subscribers: mgorny, lebedev.ri, #sanitizers, lldb-commits, llvm-commits
Tags: #sanitizers, #lldb, #llvm
Differential Revision: https://reviews.llvm.org/D63370
llvm-svn: 363821
2019-06-19 23:25:32 +08:00
|
|
|
message(STATUS "Creating ${name}")
|
2015-09-15 07:09:06 +08:00
|
|
|
|
|
|
|
execute_process(
|
2021-04-07 17:23:10 +08:00
|
|
|
COMMAND "${CMAKE_COMMAND}" -E create_symlink "${target}" "${name}"
|
|
|
|
WORKING_DIRECTORY "${bindir}" ERROR_VARIABLE has_err)
|
|
|
|
if(CMAKE_HOST_WIN32 AND has_err)
|
|
|
|
execute_process(
|
|
|
|
COMMAND "${CMAKE_COMMAND}" -E copy "${target}" "${name}"
|
|
|
|
WORKING_DIRECTORY "${bindir}")
|
|
|
|
endif()
|
2015-09-15 07:09:06 +08:00
|
|
|
|
|
|
|
endfunction()
|