[CMake] If you're not installing the libcxx library, exclude it from the "all" target so it doesn't get built when you run "ninja install"
This is just a build dependency optimization. Running check-libcxx will still build libcxx and function as expected, it just removes libcxx from the all build and install targets. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@254628 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
a3866e4c89
commit
a846b11cd8
@ -24,10 +24,14 @@ if (MSVC_IDE OR XCODE)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(NOT LIBCXX_INSTALL_LIBRARY)
|
||||||
|
set(exclude_from_all EXCLUDE_FROM_ALL)
|
||||||
|
endif()
|
||||||
|
|
||||||
if (LIBCXX_ENABLE_SHARED)
|
if (LIBCXX_ENABLE_SHARED)
|
||||||
add_library(cxx SHARED ${LIBCXX_SOURCES} ${LIBCXX_HEADERS})
|
add_library(cxx SHARED ${exclude_from_all} ${LIBCXX_SOURCES} ${LIBCXX_HEADERS})
|
||||||
else()
|
else()
|
||||||
add_library(cxx STATIC ${LIBCXX_SOURCES} ${LIBCXX_HEADERS})
|
add_library(cxx STATIC ${exclude_from_all} ${LIBCXX_SOURCES} ${LIBCXX_HEADERS})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (DEFINED LIBCXX_CXX_ABI_DEPS)
|
if (DEFINED LIBCXX_CXX_ABI_DEPS)
|
||||||
@ -172,8 +176,11 @@ endif()
|
|||||||
|
|
||||||
if (NOT CMAKE_CONFIGURATION_TYPES AND (LIBCXX_INSTALL_LIBRARY OR
|
if (NOT CMAKE_CONFIGURATION_TYPES AND (LIBCXX_INSTALL_LIBRARY OR
|
||||||
LIBCXX_INSTALL_HEADERS))
|
LIBCXX_INSTALL_HEADERS))
|
||||||
|
if(LIBCXX_INSTALL_LIBRARY)
|
||||||
|
set(deps DEPENDS cxx)
|
||||||
|
endif()
|
||||||
add_custom_target(install-libcxx
|
add_custom_target(install-libcxx
|
||||||
DEPENDS cxx
|
${deps}
|
||||||
COMMAND "${CMAKE_COMMAND}"
|
COMMAND "${CMAKE_COMMAND}"
|
||||||
-DCMAKE_INSTALL_COMPONENT=libcxx
|
-DCMAKE_INSTALL_COMPONENT=libcxx
|
||||||
-P "${LIBCXX_BINARY_DIR}/cmake_install.cmake")
|
-P "${LIBCXX_BINARY_DIR}/cmake_install.cmake")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user