Create new library 'libc++experimental.a' for packaging TS symbols.

Summary:
Out-of-line symbols for <experimental/...> headers are not ABI or API stable and cannot live in the 'libc++.dylib'. Currently they have nowhere to live. I would like to add a new library target `libc++experimental.a` to fix this. 

Previously I had suggested different libraries for different TS's (`libc++filesystem.a`, 'libc++LFTS.a`, ect). I no longer think this is the right approach.
Instead `c++experimental` will hold *all* TS implementations as a single monolithic library. I see two main benefits to this:

1. Users only have to know about and manually link one library.
2. It makes it easy to implement TS's with one or two out-of-line symbols. (Ex. PMRs)

`c++experimental` provides NO ABI compatibility. Symbols can freely be added/removed/changed without concern for ABI stability.
I will add documentation for this after landing this patch (but before adding anything to it).

`c++experimental` only builds as a static library. By default CMake will build/test this library but will *NOT* install it.

This patch adds the CMake and LIT logic needed to build/test the new library. Once this lands I plan on using it to implement parts of `<experimental/memory_resource>`.



Reviewers: mclow.lists

Subscribers: cfe-commits, theraven, krememek, dexonsmith, bcraig, beanz, danalbert

Differential Revision: http://reviews.llvm.org/D19856

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@268443 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
index a090422..1d38304 100644
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
@@ -138,6 +138,17 @@
     SOVERSION     "${LIBCXX_ABI_VERSION}"
   )
 
+if (LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY)
+  file(GLOB LIBCXX_EXPERIMENTAL_SOURCES ../src/experimental/*.cpp)
+  add_library(cxx_experimental STATIC ${LIBCXX_EXPERIMENTAL_SOURCES})
+  target_link_libraries(cxx_experimental cxx)
+  set_target_properties(cxx_experimental
+    PROPERTIES
+      COMPILE_FLAGS "${LIBCXX_COMPILE_FLAGS}"
+      OUTPUT_NAME   "c++experimental"
+  )
+endif()
+
 # Generate a linker script inplace of a libc++.so symlink. Rerun this command
 # after cxx builds.
 if (LIBCXX_ENABLE_ABI_LINKER_SCRIPT)
@@ -160,7 +171,10 @@
 endif()
 
 if (LIBCXX_INSTALL_LIBRARY)
-  install(TARGETS cxx
+  if (LIBCXX_INSTALL_EXPERIMENTAL_LIBRARY)
+    set(experimental_lib cxx_experimental)
+  endif()
+  install(TARGETS cxx ${experimental_lib}
     LIBRARY DESTINATION lib${LIBCXX_LIBDIR_SUFFIX} COMPONENT libcxx
     ARCHIVE DESTINATION lib${LIBCXX_LIBDIR_SUFFIX} COMPONENT libcxx
     )
@@ -180,11 +194,16 @@
     if(LIBCXX_INSTALL_LIBRARY)
       set(lib_install_target cxx)
     endif()
+    if (LIBCXX_INSTALL_EXPERIMENTAL_LIBRARY)
+      set(experimental_lib_install_target cxx_experimental)
+    endif()
     if(LIBCXX_INSTALL_HEADERS)
       set(header_install_target install-libcxx-headers)
     endif()
     add_custom_target(install-libcxx
-                      DEPENDS ${lib_install_target} ${header_install_target}
+                      DEPENDS ${lib_install_target}
+                              ${experimental_lib_install_target}
+                              ${header_install_target}
                       COMMAND "${CMAKE_COMMAND}"
                       -DCMAKE_INSTALL_COMPONENT=libcxx
                       -P "${LIBCXX_BINARY_DIR}/cmake_install.cmake")