mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-26 07:34:11 +00:00
82 lines
4.0 KiB
Diff
82 lines
4.0 KiB
Diff
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||
|
index 06ee1d74a03e..6c3c6f8f8d47 100644
|
||
|
--- a/CMakeLists.txt
|
||
|
+++ b/CMakeLists.txt
|
||
|
@@ -28,6 +28,8 @@ set(LIBCXX_BINARY_INCLUDE_DIR "${LIBCXX_BINARY_DIR}/include/c++build")
|
||
|
if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR OR LIBCXX_STANDALONE_BUILD)
|
||
|
project(libcxx CXX C)
|
||
|
|
||
|
+ include(GNUInstallDirs)
|
||
|
+
|
||
|
set(PACKAGE_NAME libcxx)
|
||
|
set(PACKAGE_VERSION 13.0.0git)
|
||
|
set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
|
||
|
@@ -409,7 +411,7 @@ if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE)
|
||
|
set(LIBCXX_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}/${LLVM_DEFAULT_TARGET_TRIPLE})
|
||
|
set(LIBCXX_GENERATED_INCLUDE_DIR "${LLVM_BINARY_DIR}/include/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})
|
||
|
+ set(LIBCXX_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}${LLVM_LIBDIR_SUFFIX}/${LLVM_DEFAULT_TARGET_TRIPLE})
|
||
|
set(LIBCXX_INSTALL_INCLUDE_DIR "include/c++/v1")
|
||
|
set(LIBCXX_INSTALL_INCLUDE_TARGET_DIR "include/${LLVM_DEFAULT_TARGET_TRIPLE}/c++/v1")
|
||
|
if(LIBCXX_LIBDIR_SUBDIR)
|
||
|
@@ -420,14 +422,14 @@ elseif(LLVM_LIBRARY_OUTPUT_INTDIR)
|
||
|
set(LIBCXX_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR})
|
||
|
set(LIBCXX_GENERATED_INCLUDE_DIR "${LLVM_BINARY_DIR}/include/c++/v1")
|
||
|
set(LIBCXX_GENERATED_INCLUDE_TARGET_DIR "${LIBCXX_GENERATED_INCLUDE_DIR}")
|
||
|
- set(LIBCXX_INSTALL_LIBRARY_DIR lib${LIBCXX_LIBDIR_SUFFIX})
|
||
|
+ set(LIBCXX_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}${LIBCXX_LIBDIR_SUFFIX})
|
||
|
set(LIBCXX_INSTALL_INCLUDE_DIR "include/c++/v1")
|
||
|
set(LIBCXX_INSTALL_INCLUDE_TARGET_DIR "${LIBCXX_INSTALL_INCLUDE_DIR}")
|
||
|
else()
|
||
|
set(LIBCXX_LIBRARY_DIR ${CMAKE_BINARY_DIR}/lib${LIBCXX_LIBDIR_SUFFIX})
|
||
|
set(LIBCXX_GENERATED_INCLUDE_DIR "${CMAKE_BINARY_DIR}/include/c++/v1")
|
||
|
set(LIBCXX_GENERATED_INCLUDE_TARGET_DIR "${LIBCXX_GENERATED_INCLUDE_DIR}")
|
||
|
- set(LIBCXX_INSTALL_LIBRARY_DIR lib${LIBCXX_LIBDIR_SUFFIX})
|
||
|
+ set(LIBCXX_INSTALL_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR}${LIBCXX_LIBDIR_SUFFIX})
|
||
|
set(LIBCXX_INSTALL_INCLUDE_DIR "include/c++/v1")
|
||
|
set(LIBCXX_INSTALL_INCLUDE_TARGET_DIR "${LIBCXX_INSTALL_INCLUDE_DIR}")
|
||
|
endif()
|
||
|
diff --git a/cmake/Modules/HandleLibCXXABI.cmake b/cmake/Modules/HandleLibCXXABI.cmake
|
||
|
index 5a8a4a270a1a..c06bae0001aa 100644
|
||
|
--- a/cmake/Modules/HandleLibCXXABI.cmake
|
||
|
+++ b/cmake/Modules/HandleLibCXXABI.cmake
|
||
|
@@ -63,7 +63,7 @@ macro(setup_abi_lib abidefines abishared abistatic abifiles abidirs)
|
||
|
|
||
|
if (LIBCXX_INSTALL_HEADERS)
|
||
|
install(FILES "${LIBCXX_BINARY_INCLUDE_DIR}/${fpath}"
|
||
|
- DESTINATION include/c++/v1/${dstdir}
|
||
|
+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/c++/v1/${dstdir}
|
||
|
COMPONENT cxx-headers
|
||
|
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
|
||
|
)
|
||
|
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
|
||
|
index 87b71f7ba334..d20a783079b7 100644
|
||
|
--- a/src/CMakeLists.txt
|
||
|
+++ b/src/CMakeLists.txt
|
||
|
@@ -369,21 +369,21 @@ if (LIBCXX_INSTALL_SHARED_LIBRARY)
|
||
|
install(TARGETS cxx_shared
|
||
|
ARCHIVE DESTINATION ${LIBCXX_INSTALL_LIBRARY_DIR} COMPONENT cxx
|
||
|
LIBRARY DESTINATION ${LIBCXX_INSTALL_LIBRARY_DIR} COMPONENT cxx
|
||
|
- RUNTIME DESTINATION bin COMPONENT cxx)
|
||
|
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT cxx)
|
||
|
endif()
|
||
|
|
||
|
if (LIBCXX_INSTALL_STATIC_LIBRARY)
|
||
|
install(TARGETS cxx_static
|
||
|
ARCHIVE DESTINATION ${LIBCXX_INSTALL_LIBRARY_DIR} COMPONENT cxx
|
||
|
LIBRARY DESTINATION ${LIBCXX_INSTALL_LIBRARY_DIR} COMPONENT cxx
|
||
|
- RUNTIME DESTINATION bin COMPONENT cxx)
|
||
|
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT cxx)
|
||
|
endif()
|
||
|
|
||
|
if(LIBCXX_INSTALL_EXPERIMENTAL_LIBRARY)
|
||
|
install(TARGETS cxx_experimental
|
||
|
LIBRARY DESTINATION ${LIBCXX_INSTALL_LIBRARY_DIR} COMPONENT cxx
|
||
|
ARCHIVE DESTINATION ${LIBCXX_INSTALL_LIBRARY_DIR} COMPONENT cxx
|
||
|
- RUNTIME DESTINATION bin COMPONENT cxx)
|
||
|
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT cxx)
|
||
|
endif()
|
||
|
|
||
|
# NOTE: This install command must go after the cxx install command otherwise
|