[compiler-rt][cmake] Use `GNUInstallDirs` to support custom installation dirs

I am breaking apart D99484 so the cause of build failures is easier to
understand.

Differential Revision: https://reviews.llvm.org/D117420
This commit is contained in:
John Ericson 2022-01-16 06:19:45 +00:00
parent 5a457782a2
commit 09949c48cb
1 changed files with 4 additions and 3 deletions

View File

@ -5,6 +5,7 @@
include(CheckIncludeFile)
include(CheckCXXSourceCompiles)
include(GNUInstallDirs)
include(ExtendPath)
check_include_file(unwind.h HAVE_UNWIND_H)
@ -108,13 +109,13 @@ else(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE)
set(COMPILER_RT_INSTALL_LIBRARY_DIR "${default_install_path}" CACHE PATH
"Path where built compiler-rt libraries should be installed.")
endif()
extend_path(default_install_path "${COMPILER_RT_INSTALL_PATH}" bin)
extend_path(default_install_path "${COMPILER_RT_INSTALL_PATH}" "${CMAKE_INSTALL_BINDIR}")
set(COMPILER_RT_INSTALL_BINARY_DIR "${default_install_path}" CACHE PATH
"Path where built compiler-rt executables should be installed.")
extend_path(default_install_path "${COMPILER_RT_INSTALL_PATH}" include)
extend_path(default_install_path "${COMPILER_RT_INSTALL_PATH}" "${CMAKE_INSTALL_INCLUDEDIR}")
set(COMPILER_RT_INSTALL_INCLUDE_DIR "${default_install_path}" CACHE PATH
"Path where compiler-rt headers should be installed.")
extend_path(default_install_path "${COMPILER_RT_INSTALL_PATH}" share)
extend_path(default_install_path "${COMPILER_RT_INSTALL_PATH}" "${CMAKE_INSTALL_DATADIR}")
set(COMPILER_RT_INSTALL_DATA_DIR "${default_install_path}" CACHE PATH
"Path where compiler-rt data files should be installed.")