From: Louis Dionne Date: Fri, 9 Oct 2020 19:04:12 +0000 (-0400) Subject: [libc++] Remove redundant if(LIBCXX_INSTALL_LIBRARY) X-Git-Tag: llvmorg-13-init~9663 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4bd3d16c2d629fd06a2a60e45a501f4230da9633;p=platform%2Fupstream%2Fllvm.git [libc++] Remove redundant if(LIBCXX_INSTALL_LIBRARY) The individual LIBCXX_INSTALL_(SHARED|STATIC)_LIBRARY are already dependent on whether LIBCXX_INSTALL_LIBRARY is ON or OFF. --- diff --git a/libcxx/src/CMakeLists.txt b/libcxx/src/CMakeLists.txt index 7f77a78..eab2152 100644 --- a/libcxx/src/CMakeLists.txt +++ b/libcxx/src/CMakeLists.txt @@ -340,41 +340,38 @@ if (LIBCXX_BUILD_EXTERNAL_THREAD_LIBRARY) target_link_libraries(cxx_external_threads PRIVATE cxx-headers) endif() -if (LIBCXX_INSTALL_LIBRARY) - if (LIBCXX_INSTALL_SHARED_LIBRARY) - install(TARGETS cxx_shared - ARCHIVE DESTINATION ${LIBCXX_INSTALL_PREFIX}${LIBCXX_INSTALL_LIBRARY_DIR} COMPONENT cxx - LIBRARY DESTINATION ${LIBCXX_INSTALL_PREFIX}${LIBCXX_INSTALL_LIBRARY_DIR} COMPONENT cxx - RUNTIME DESTINATION ${LIBCXX_INSTALL_PREFIX}bin COMPONENT cxx) - endif() +if (LIBCXX_INSTALL_SHARED_LIBRARY) + install(TARGETS cxx_shared + ARCHIVE DESTINATION ${LIBCXX_INSTALL_PREFIX}${LIBCXX_INSTALL_LIBRARY_DIR} COMPONENT cxx + LIBRARY DESTINATION ${LIBCXX_INSTALL_PREFIX}${LIBCXX_INSTALL_LIBRARY_DIR} COMPONENT cxx + RUNTIME DESTINATION ${LIBCXX_INSTALL_PREFIX}bin COMPONENT cxx) +endif() - if (LIBCXX_INSTALL_STATIC_LIBRARY) - install(TARGETS cxx_static - ARCHIVE DESTINATION ${LIBCXX_INSTALL_PREFIX}${LIBCXX_INSTALL_LIBRARY_DIR} COMPONENT cxx - LIBRARY DESTINATION ${LIBCXX_INSTALL_PREFIX}${LIBCXX_INSTALL_LIBRARY_DIR} COMPONENT cxx - RUNTIME DESTINATION ${LIBCXX_INSTALL_PREFIX}bin COMPONENT cxx) - endif() +if (LIBCXX_INSTALL_STATIC_LIBRARY) + install(TARGETS cxx_static + ARCHIVE DESTINATION ${LIBCXX_INSTALL_PREFIX}${LIBCXX_INSTALL_LIBRARY_DIR} COMPONENT cxx + LIBRARY DESTINATION ${LIBCXX_INSTALL_PREFIX}${LIBCXX_INSTALL_LIBRARY_DIR} COMPONENT cxx + RUNTIME DESTINATION ${LIBCXX_INSTALL_PREFIX}bin COMPONENT cxx) +endif() - if(LIBCXX_INSTALL_EXPERIMENTAL_LIBRARY) - install(TARGETS cxx_experimental - LIBRARY DESTINATION ${LIBCXX_INSTALL_PREFIX}${LIBCXX_INSTALL_LIBRARY_DIR} COMPONENT cxx - ARCHIVE DESTINATION ${LIBCXX_INSTALL_PREFIX}${LIBCXX_INSTALL_LIBRARY_DIR} COMPONENT cxx - RUNTIME DESTINATION ${LIBCXX_INSTALL_PREFIX}bin COMPONENT cxx) - endif() +if(LIBCXX_INSTALL_EXPERIMENTAL_LIBRARY) + install(TARGETS cxx_experimental + LIBRARY DESTINATION ${LIBCXX_INSTALL_PREFIX}${LIBCXX_INSTALL_LIBRARY_DIR} COMPONENT cxx + ARCHIVE DESTINATION ${LIBCXX_INSTALL_PREFIX}${LIBCXX_INSTALL_LIBRARY_DIR} COMPONENT cxx + RUNTIME DESTINATION ${LIBCXX_INSTALL_PREFIX}bin COMPONENT cxx) +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 $ - # after we required CMake 3.0. - install(FILES "${LIBCXX_LIBRARY_DIR}/libc++${CMAKE_SHARED_LIBRARY_SUFFIX}" - DESTINATION ${LIBCXX_INSTALL_PREFIX}${LIBCXX_INSTALL_LIBRARY_DIR} - COMPONENT libcxx) - 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 $ + # after we required CMake 3.0. + install(FILES "${LIBCXX_LIBRARY_DIR}/libc++${CMAKE_SHARED_LIBRARY_SUFFIX}" + DESTINATION ${LIBCXX_INSTALL_PREFIX}${LIBCXX_INSTALL_LIBRARY_DIR} + COMPONENT libcxx) endif() -if (NOT CMAKE_CONFIGURATION_TYPES AND (LIBCXX_INSTALL_LIBRARY OR - LIBCXX_INSTALL_HEADERS)) +if (NOT CMAKE_CONFIGURATION_TYPES) if(LIBCXX_INSTALL_LIBRARY) set(lib_install_target cxx) endif()