forked from mirrors/nixpkgs
7869d16545
Also begin to start work on cross compilation, though that will have to
be finished later.
The patches are based on the first version of
https://reviews.llvm.org/D99484. It's very annoying to do the
back-porting but the review has uncovered nothing super major so I'm
fine sticking with what I've got.
Beyond making the outputs work, I also strove to re-sync the packages,
as they have been drifting pointlessly apart for some time.
----
Other misc notes, highly incomplete
- lvm-config-native and llvm-config are put in `dev` because they are
tools just for build time.
- Clang no longer has an lld dep. That was introduced in
db29857eb3
, but if clang needs help
finding lld when it is used we should just pass it flags / put in the
resource dir. Providing it at build time increases critical path
length for no good reason.
----
A note on `nativeCC`:
`stdenv` takes tools from the previous stage, so:
1. `pkgsBuildBuild`: `(?1, x, x)`
2. `pkgsBuildBuild.stdenv.cc`: `(?0, ?1, x)`
while:
1. `pkgsBuildBuild`: `(?1, x, x)`
2. `pkgsBuildBuild.targetPackages`: `(x, x, ?2)`
3. `pkgsBuildBuild.targetPackages.stdenv.cc`: `(?1, x, x)`
73 lines
3.2 KiB
Diff
73 lines
3.2 KiB
Diff
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
|
index 9e8e9d5e3d9b..e1d6d2392b92 100644
|
|
--- a/CMakeLists.txt
|
|
+++ b/CMakeLists.txt
|
|
@@ -22,6 +22,8 @@ set(CMAKE_MODULE_PATH
|
|
if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
|
|
project(libcxx CXX C)
|
|
|
|
+ include(GNUInstallDirs)
|
|
+
|
|
set(PACKAGE_NAME libcxx)
|
|
set(PACKAGE_VERSION 6.0.0)
|
|
set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
|
|
diff --git a/cmake/Modules/HandleLibCXXABI.cmake b/cmake/Modules/HandleLibCXXABI.cmake
|
|
index 558e11ba2cc1..c6a99cec0191 100644
|
|
--- a/cmake/Modules/HandleLibCXXABI.cmake
|
|
+++ b/cmake/Modules/HandleLibCXXABI.cmake
|
|
@@ -55,7 +55,7 @@ macro(setup_abi_lib abidefines abilib abifiles abidirs)
|
|
)
|
|
if (LIBCXX_INSTALL_HEADERS)
|
|
install(FILES "${LIBCXX_BINARY_INCLUDE_DIR}/${fpath}"
|
|
- DESTINATION ${LIBCXX_INSTALL_PREFIX}include/c++/v1/${dstdir}
|
|
+ DESTINATION ${LIBCXX_INSTALL_PREFIX}${CMAKE_INSTALL_INCLUDEDIR}/c++/v1/${dstdir}
|
|
COMPONENT cxx-headers
|
|
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
|
|
)
|
|
diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt
|
|
index b98e09260ca1..c920f48697bc 100644
|
|
--- a/include/CMakeLists.txt
|
|
+++ b/include/CMakeLists.txt
|
|
@@ -20,7 +20,7 @@ endif()
|
|
|
|
if (LIBCXX_INSTALL_HEADERS)
|
|
install(DIRECTORY .
|
|
- DESTINATION ${LIBCXX_INSTALL_PREFIX}include/c++/v1
|
|
+ DESTINATION ${LIBCXX_INSTALL_PREFIX}${CMAKE_INSTALL_INCLUDEDIR}/c++/v1
|
|
COMPONENT cxx-headers
|
|
FILES_MATCHING
|
|
${LIBCXX_HEADER_PATTERN}
|
|
@@ -44,7 +44,7 @@ if (LIBCXX_INSTALL_HEADERS)
|
|
set(generated_config_deps generate_config_header)
|
|
# Install the generated header as __config.
|
|
install(FILES ${LIBCXX_BINARY_DIR}/__generated_config
|
|
- DESTINATION ${LIBCXX_INSTALL_PREFIX}include/c++/v1
|
|
+ DESTINATION ${LIBCXX_INSTALL_PREFIX}${CMAKE_INSTALL_INCLUDEDIR}/c++/v1
|
|
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
|
|
RENAME __config
|
|
COMPONENT cxx-headers)
|
|
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
|
|
index aa5ebf1568ec..36d85b94c3ba 100644
|
|
--- a/lib/CMakeLists.txt
|
|
+++ b/lib/CMakeLists.txt
|
|
@@ -357,8 +357,8 @@ if (LIBCXX_INSTALL_LIBRARY)
|
|
set(experimental_lib cxx_experimental)
|
|
endif()
|
|
install(TARGETS ${LIBCXX_TARGETS} ${experimental_lib}
|
|
- LIBRARY DESTINATION ${LIBCXX_INSTALL_PREFIX}lib${LIBCXX_LIBDIR_SUFFIX} COMPONENT cxx
|
|
- ARCHIVE DESTINATION ${LIBCXX_INSTALL_PREFIX}lib${LIBCXX_LIBDIR_SUFFIX} COMPONENT cxx
|
|
+ LIBRARY DESTINATION ${LIBCXX_INSTALL_PREFIX}${CMAKE_INSTALL_LIBDIR}${LIBCXX_LIBDIR_SUFFIX} COMPONENT cxx
|
|
+ ARCHIVE DESTINATION ${LIBCXX_INSTALL_PREFIX}${CMAKE_INSTALL_LIBDIR}${LIBCXX_LIBDIR_SUFFIX} COMPONENT cxx
|
|
)
|
|
# NOTE: This install command must go after the cxx install command otherwise
|
|
# it will not be executed after the library symlinks are installed.
|
|
@@ -366,7 +366,7 @@ if (LIBCXX_INSTALL_LIBRARY)
|
|
# Replace the libc++ filename with $<TARGET_LINKER_FILE:cxx>
|
|
# after we required CMake 3.0.
|
|
install(FILES "${LIBCXX_LIBRARY_DIR}/libc++${CMAKE_SHARED_LIBRARY_SUFFIX}"
|
|
- DESTINATION ${LIBCXX_INSTALL_PREFIX}lib${LIBCXX_LIBDIR_SUFFIX}
|
|
+ DESTINATION ${LIBCXX_INSTALL_PREFIX}${CMAKE_INSTALL_LIBDIR}${LIBCXX_LIBDIR_SUFFIX}
|
|
COMPONENT libcxx)
|
|
endif()
|
|
endif()
|