mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-04-03 22:02:12 +00:00
[libcxx][libcxxabi][libunwind][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/D117417
This commit is contained in:
parent
c8e047f5e1
commit
f16a4a034a
@ -10,6 +10,8 @@ endif()
|
|||||||
#===============================================================================
|
#===============================================================================
|
||||||
cmake_minimum_required(VERSION 3.13.4)
|
cmake_minimum_required(VERSION 3.13.4)
|
||||||
|
|
||||||
|
include(GNUInstallDirs)
|
||||||
|
|
||||||
set(LLVM_COMMON_CMAKE_UTILS "${CMAKE_CURRENT_SOURCE_DIR}/../cmake")
|
set(LLVM_COMMON_CMAKE_UTILS "${CMAKE_CURRENT_SOURCE_DIR}/../cmake")
|
||||||
|
|
||||||
# Add path for custom modules
|
# Add path for custom modules
|
||||||
@ -412,9 +414,9 @@ endif ()
|
|||||||
# TODO: Projects that depend on libc++ should use LIBCXX_GENERATED_INCLUDE_DIR
|
# TODO: Projects that depend on libc++ should use LIBCXX_GENERATED_INCLUDE_DIR
|
||||||
# instead of hard-coding include/c++/v1.
|
# instead of hard-coding include/c++/v1.
|
||||||
|
|
||||||
set(LIBCXX_INSTALL_INCLUDE_DIR "include/c++/v1" CACHE PATH
|
set(LIBCXX_INSTALL_INCLUDE_DIR "${CMAKE_INSTALL_INCLUDEDIR}/c++/v1" CACHE PATH
|
||||||
"Path where target-agnostic libc++ headers should be installed.")
|
"Path where target-agnostic libc++ headers should be installed.")
|
||||||
set(LIBCXX_INSTALL_RUNTIME_DIR bin CACHE PATH
|
set(LIBCXX_INSTALL_RUNTIME_DIR "${CMAKE_INSTALL_BINDIR}" CACHE PATH
|
||||||
"Path where built libc++ runtime libraries should be installed.")
|
"Path where built libc++ runtime libraries should be installed.")
|
||||||
|
|
||||||
if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE)
|
if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE)
|
||||||
@ -423,7 +425,7 @@ if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE)
|
|||||||
set(LIBCXX_GENERATED_INCLUDE_TARGET_DIR "${LLVM_BINARY_DIR}/include/${LLVM_DEFAULT_TARGET_TRIPLE}/c++/v1")
|
set(LIBCXX_GENERATED_INCLUDE_TARGET_DIR "${LLVM_BINARY_DIR}/include/${LLVM_DEFAULT_TARGET_TRIPLE}/c++/v1")
|
||||||
set(LIBCXX_INSTALL_LIBRARY_DIR lib${LLVM_LIBDIR_SUFFIX}/${LLVM_DEFAULT_TARGET_TRIPLE} CACHE PATH
|
set(LIBCXX_INSTALL_LIBRARY_DIR lib${LLVM_LIBDIR_SUFFIX}/${LLVM_DEFAULT_TARGET_TRIPLE} CACHE PATH
|
||||||
"Path where built libc++ libraries should be installed.")
|
"Path where built libc++ libraries should be installed.")
|
||||||
set(LIBCXX_INSTALL_INCLUDE_TARGET_DIR "include/${LLVM_DEFAULT_TARGET_TRIPLE}/c++/v1" CACHE PATH
|
set(LIBCXX_INSTALL_INCLUDE_TARGET_DIR "${CMAKE_INSTALL_INCLUDEDIR}/${LLVM_DEFAULT_TARGET_TRIPLE}/c++/v1" CACHE PATH
|
||||||
"Path where target-specific libc++ headers should be installed.")
|
"Path where target-specific libc++ headers should be installed.")
|
||||||
if(LIBCXX_LIBDIR_SUBDIR)
|
if(LIBCXX_LIBDIR_SUBDIR)
|
||||||
string(APPEND LIBCXX_LIBRARY_DIR /${LIBCXX_LIBDIR_SUBDIR})
|
string(APPEND LIBCXX_LIBRARY_DIR /${LIBCXX_LIBDIR_SUBDIR})
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
|
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
# Add an ABI library if appropriate
|
# Add an ABI library if appropriate
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
|
|
||||||
|
include(GNUInstallDirs)
|
||||||
|
|
||||||
#
|
#
|
||||||
# _setup_abi: Set up the build to use an ABI library
|
# _setup_abi: Set up the build to use an ABI library
|
||||||
#
|
#
|
||||||
@ -63,7 +64,7 @@ macro(setup_abi_lib abidefines abishared abistatic abifiles abidirs)
|
|||||||
|
|
||||||
if (LIBCXX_INSTALL_HEADERS)
|
if (LIBCXX_INSTALL_HEADERS)
|
||||||
install(FILES "${LIBCXX_BINARY_INCLUDE_DIR}/${fpath}"
|
install(FILES "${LIBCXX_BINARY_INCLUDE_DIR}/${fpath}"
|
||||||
DESTINATION include/c++/v1/${dstdir}
|
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/c++/v1/${dstdir}"
|
||||||
COMPONENT cxx-headers
|
COMPONENT cxx-headers
|
||||||
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
|
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
|
||||||
)
|
)
|
||||||
|
@ -10,6 +10,8 @@ endif()
|
|||||||
|
|
||||||
cmake_minimum_required(VERSION 3.13.4)
|
cmake_minimum_required(VERSION 3.13.4)
|
||||||
|
|
||||||
|
include(GNUInstallDirs)
|
||||||
|
|
||||||
set(LLVM_COMMON_CMAKE_UTILS "${CMAKE_CURRENT_SOURCE_DIR}/../cmake")
|
set(LLVM_COMMON_CMAKE_UTILS "${CMAKE_CURRENT_SOURCE_DIR}/../cmake")
|
||||||
|
|
||||||
# Add path for custom modules
|
# Add path for custom modules
|
||||||
@ -210,7 +212,7 @@ set(CMAKE_MODULE_PATH
|
|||||||
${CMAKE_MODULE_PATH}
|
${CMAKE_MODULE_PATH}
|
||||||
)
|
)
|
||||||
|
|
||||||
set(LIBCXXABI_INSTALL_RUNTIME_DIR bin CACHE PATH
|
set(LIBCXXABI_INSTALL_RUNTIME_DIR "${CMAKE_INSTALL_BINDIR}" CACHE PATH
|
||||||
"Path where built libc++abi runtime libraries should be installed.")
|
"Path where built libc++abi runtime libraries should be installed.")
|
||||||
|
|
||||||
if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE)
|
if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE)
|
||||||
|
@ -8,6 +8,8 @@ endif()
|
|||||||
|
|
||||||
cmake_minimum_required(VERSION 3.13.4)
|
cmake_minimum_required(VERSION 3.13.4)
|
||||||
|
|
||||||
|
include(GNUInstallDirs)
|
||||||
|
|
||||||
set(LLVM_COMMON_CMAKE_UTILS "${CMAKE_CURRENT_SOURCE_DIR}/../cmake")
|
set(LLVM_COMMON_CMAKE_UTILS "${CMAKE_CURRENT_SOURCE_DIR}/../cmake")
|
||||||
|
|
||||||
# Add path for custom modules
|
# Add path for custom modules
|
||||||
@ -137,9 +139,9 @@ set(CMAKE_MODULE_PATH
|
|||||||
"${CMAKE_CURRENT_SOURCE_DIR}/cmake"
|
"${CMAKE_CURRENT_SOURCE_DIR}/cmake"
|
||||||
${CMAKE_MODULE_PATH})
|
${CMAKE_MODULE_PATH})
|
||||||
|
|
||||||
set(LIBUNWIND_INSTALL_INCLUDE_DIR include CACHE PATH
|
set(LIBUNWIND_INSTALL_INCLUDE_DIR "${CMAKE_INSTALL_INCLUDEDIR}" CACHE PATH
|
||||||
"Path where built libunwind headers should be installed.")
|
"Path where built libunwind headers should be installed.")
|
||||||
set(LIBUNWIND_INSTALL_RUNTIME_DIR bin CACHE PATH
|
set(LIBUNWIND_INSTALL_RUNTIME_DIR "${CMAKE_INSTALL_BINDIR}" CACHE PATH
|
||||||
"Path where built libunwind runtime libraries should be installed.")
|
"Path where built libunwind runtime libraries should be installed.")
|
||||||
|
|
||||||
if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE)
|
if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user