Make headers available in the build directory
authorJustin Bogner <mail@justinbogner.com>
Thu, 23 Oct 2014 16:51:12 +0000 (16:51 +0000)
committerJustin Bogner <mail@justinbogner.com>
Thu, 23 Oct 2014 16:51:12 +0000 (16:51 +0000)
This essentially re-does r194825 and makes it possible to run clang
with libc++ without having to install it, even if you don't have any
version of libc++ installed in /usr/.

This behaviour broke in r210577/r211629, which fixed pr18681.

llvm-svn: 220489

libcxx/include/CMakeLists.txt

index bbf7ea4..df2cd34 100644 (file)
@@ -1,13 +1,22 @@
 if (NOT LIBCXX_INSTALL_SUPPORT_HEADERS)
   set(LIBCXX_SUPPORT_HEADER_PATTERN PATTERN "support" EXCLUDE)
 endif()
-
-install(DIRECTORY .
-  DESTINATION include/c++/v1
-  FILES_MATCHING
+set(LIBCXX_HEADER_PATTERN
   PATTERN "*"
   PATTERN "CMakeLists.txt" EXCLUDE
   PATTERN ".svn" EXCLUDE
   ${LIBCXX_SUPPORT_HEADER_PATTERN}
+  )
+
+file(COPY .
+  DESTINATION "${CMAKE_BINARY_DIR}/include/c++/v1"
+  FILES_MATCHING
+  ${LIBCXX_HEADER_PATTERN}
+  )
+
+install(DIRECTORY .
+  DESTINATION include/c++/v1
+  FILES_MATCHING
+  ${LIBCXX_HEADER_PATTERN}
   PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
   )