Enforce that libc++ and libc++abi are built in a monorepo layout
authorLouis Dionne <ldionne@apple.com>
Thu, 12 Mar 2020 22:01:20 +0000 (18:01 -0400)
committerLouis Dionne <ldionne@apple.com>
Mon, 30 Mar 2020 21:57:36 +0000 (17:57 -0400)
We will soon start removing technical debt and sharing code between the
two directories, so this first step is meant to discover potential places
where the libraries are built outside of a monorepo layout. I imagine
this could happen as a remnant of the pre-monorepo setup.

This was discussed on the libcxx-dev mailing list and we got overall
consensus on the direction. All consumers of libc++ and libc++abi
should already be doing so through the monorepo, however it is
possible that we catch some stragglers with this patch, in which
case it may need to be reverted temporarily.

Differential Revision: https://reviews.llvm.org/D76102

libcxx/CMakeLists.txt
libcxxabi/CMakeLists.txt

index 8bdb24e..0aeb07d 100644 (file)
@@ -1,6 +1,10 @@
 # See https://libcxx.llvm.org/docs/BuildingLibcxx.html for instructions on how
 # to build libcxx with CMake.
 
+if (NOT IS_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/../libcxxabi")
+  message(FATAL_ERROR "libc++ now requires being built in a monorepo layout with libcxxabi available")
+endif()
+
 #===============================================================================
 # Setup Project
 #===============================================================================
index 9b96224..a58789f 100644 (file)
@@ -1,5 +1,9 @@
 # See www/CMake.html for instructions on how to build libcxxabi with CMake.
 
+if (NOT IS_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/../libcxx")
+  message(FATAL_ERROR "libc++abi now requires being built in a monorepo layout with libcxx available")
+endif()
+
 #===============================================================================
 # Setup Project
 #===============================================================================