diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt index 3565169fd7c0..58abdf8a8f6e 100644 --- a/libcxx/CMakeLists.txt +++ b/libcxx/CMakeLists.txt @@ -47,6 +47,7 @@ option(LIBCXX_BUILD_32_BITS "Build 32 bit libc++" OFF) option(LIBCXX_ENABLE_MONOTONIC_CLOCK "Build libc++ with support for a monotonic clock. This option may only be used when LIBCXX_ENABLE_THREADS=OFF." ON) +option(LIBCXX_INSTALL_HEADERS "Install the libc++ headers." ON) option(LIBCXX_INSTALL_SUPPORT_HEADERS "Install libc++ support headers." ON) if (LIBCXX_BUILT_STANDALONE) set(LLVM_USE_SANITIZER "" CACHE STRING diff --git a/libcxx/include/CMakeLists.txt b/libcxx/include/CMakeLists.txt index df2cd343d21e..95206bfeeaff 100644 --- a/libcxx/include/CMakeLists.txt +++ b/libcxx/include/CMakeLists.txt @@ -14,9 +14,11 @@ file(COPY . ${LIBCXX_HEADER_PATTERN} ) -install(DIRECTORY . - DESTINATION include/c++/v1 - FILES_MATCHING - ${LIBCXX_HEADER_PATTERN} - PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ +if (LIBCXX_INSTALL_HEADERS) + install(DIRECTORY . + DESTINATION include/c++/v1 + FILES_MATCHING + ${LIBCXX_HEADER_PATTERN} + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ ) +endif()