Skip to content

Commit 4bd3d16

Browse files
committed
[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.
1 parent 5d74c43 commit 4bd3d16

File tree

1 file changed

+27
-30
lines changed

1 file changed

+27
-30
lines changed

libcxx/src/CMakeLists.txt

Lines changed: 27 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -340,41 +340,38 @@ if (LIBCXX_BUILD_EXTERNAL_THREAD_LIBRARY)
340340
target_link_libraries(cxx_external_threads PRIVATE cxx-headers)
341341
endif()
342342

343-
if (LIBCXX_INSTALL_LIBRARY)
344-
if (LIBCXX_INSTALL_SHARED_LIBRARY)
345-
install(TARGETS cxx_shared
346-
ARCHIVE DESTINATION ${LIBCXX_INSTALL_PREFIX}${LIBCXX_INSTALL_LIBRARY_DIR} COMPONENT cxx
347-
LIBRARY DESTINATION ${LIBCXX_INSTALL_PREFIX}${LIBCXX_INSTALL_LIBRARY_DIR} COMPONENT cxx
348-
RUNTIME DESTINATION ${LIBCXX_INSTALL_PREFIX}bin COMPONENT cxx)
349-
endif()
343+
if (LIBCXX_INSTALL_SHARED_LIBRARY)
344+
install(TARGETS cxx_shared
345+
ARCHIVE DESTINATION ${LIBCXX_INSTALL_PREFIX}${LIBCXX_INSTALL_LIBRARY_DIR} COMPONENT cxx
346+
LIBRARY DESTINATION ${LIBCXX_INSTALL_PREFIX}${LIBCXX_INSTALL_LIBRARY_DIR} COMPONENT cxx
347+
RUNTIME DESTINATION ${LIBCXX_INSTALL_PREFIX}bin COMPONENT cxx)
348+
endif()
350349

351-
if (LIBCXX_INSTALL_STATIC_LIBRARY)
352-
install(TARGETS cxx_static
353-
ARCHIVE DESTINATION ${LIBCXX_INSTALL_PREFIX}${LIBCXX_INSTALL_LIBRARY_DIR} COMPONENT cxx
354-
LIBRARY DESTINATION ${LIBCXX_INSTALL_PREFIX}${LIBCXX_INSTALL_LIBRARY_DIR} COMPONENT cxx
355-
RUNTIME DESTINATION ${LIBCXX_INSTALL_PREFIX}bin COMPONENT cxx)
356-
endif()
350+
if (LIBCXX_INSTALL_STATIC_LIBRARY)
351+
install(TARGETS cxx_static
352+
ARCHIVE DESTINATION ${LIBCXX_INSTALL_PREFIX}${LIBCXX_INSTALL_LIBRARY_DIR} COMPONENT cxx
353+
LIBRARY DESTINATION ${LIBCXX_INSTALL_PREFIX}${LIBCXX_INSTALL_LIBRARY_DIR} COMPONENT cxx
354+
RUNTIME DESTINATION ${LIBCXX_INSTALL_PREFIX}bin COMPONENT cxx)
355+
endif()
357356

358-
if(LIBCXX_INSTALL_EXPERIMENTAL_LIBRARY)
359-
install(TARGETS cxx_experimental
360-
LIBRARY DESTINATION ${LIBCXX_INSTALL_PREFIX}${LIBCXX_INSTALL_LIBRARY_DIR} COMPONENT cxx
361-
ARCHIVE DESTINATION ${LIBCXX_INSTALL_PREFIX}${LIBCXX_INSTALL_LIBRARY_DIR} COMPONENT cxx
362-
RUNTIME DESTINATION ${LIBCXX_INSTALL_PREFIX}bin COMPONENT cxx)
363-
endif()
357+
if(LIBCXX_INSTALL_EXPERIMENTAL_LIBRARY)
358+
install(TARGETS cxx_experimental
359+
LIBRARY DESTINATION ${LIBCXX_INSTALL_PREFIX}${LIBCXX_INSTALL_LIBRARY_DIR} COMPONENT cxx
360+
ARCHIVE DESTINATION ${LIBCXX_INSTALL_PREFIX}${LIBCXX_INSTALL_LIBRARY_DIR} COMPONENT cxx
361+
RUNTIME DESTINATION ${LIBCXX_INSTALL_PREFIX}bin COMPONENT cxx)
362+
endif()
364363

365-
# NOTE: This install command must go after the cxx install command otherwise
366-
# it will not be executed after the library symlinks are installed.
367-
if (LIBCXX_ENABLE_SHARED AND LIBCXX_ENABLE_ABI_LINKER_SCRIPT)
368-
# Replace the libc++ filename with $<TARGET_LINKER_FILE:cxx>
369-
# after we required CMake 3.0.
370-
install(FILES "${LIBCXX_LIBRARY_DIR}/libc++${CMAKE_SHARED_LIBRARY_SUFFIX}"
371-
DESTINATION ${LIBCXX_INSTALL_PREFIX}${LIBCXX_INSTALL_LIBRARY_DIR}
372-
COMPONENT libcxx)
373-
endif()
364+
# NOTE: This install command must go after the cxx install command otherwise
365+
# it will not be executed after the library symlinks are installed.
366+
if (LIBCXX_ENABLE_SHARED AND LIBCXX_ENABLE_ABI_LINKER_SCRIPT)
367+
# Replace the libc++ filename with $<TARGET_LINKER_FILE:cxx>
368+
# after we required CMake 3.0.
369+
install(FILES "${LIBCXX_LIBRARY_DIR}/libc++${CMAKE_SHARED_LIBRARY_SUFFIX}"
370+
DESTINATION ${LIBCXX_INSTALL_PREFIX}${LIBCXX_INSTALL_LIBRARY_DIR}
371+
COMPONENT libcxx)
374372
endif()
375373

376-
if (NOT CMAKE_CONFIGURATION_TYPES AND (LIBCXX_INSTALL_LIBRARY OR
377-
LIBCXX_INSTALL_HEADERS))
374+
if (NOT CMAKE_CONFIGURATION_TYPES)
378375
if(LIBCXX_INSTALL_LIBRARY)
379376
set(lib_install_target cxx)
380377
endif()

0 commit comments

Comments
 (0)