[libc++] Use generator expression to simplify the CMake code
authorLouis Dionne <ldionne.2@gmail.com>
Tue, 23 Feb 2021 23:26:15 +0000 (18:26 -0500)
committerLouis Dionne <ldionne.2@gmail.com>
Wed, 3 Mar 2021 17:59:51 +0000 (12:59 -0500)
A comment was left for when we would require CMake >= 3, which we do now.
I expect this should be a NFC.

Differential Revision: https://reviews.llvm.org/D97341

libcxx/src/CMakeLists.txt

index cfb7eb1..5dcf92a 100644 (file)
@@ -379,9 +379,7 @@ endif()
 # NOTE: This install command must go after the cxx install command otherwise
 # it will not be executed after the library symlinks are installed.
 if (LIBCXX_ENABLE_SHARED AND LIBCXX_ENABLE_ABI_LINKER_SCRIPT)
-  # 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}"
+  install(FILES "$<TARGET_LINKER_FILE:cxx_shared>"
     DESTINATION ${LIBCXX_INSTALL_PREFIX}${LIBCXX_INSTALL_LIBRARY_DIR}
     COMPONENT libcxx)
 endif()