Disable LIBCXX_ENABLE_ABI_LINKER_SCRIPT for static library builds.

This option is geared towards shared library builds and causes static
library builds to fail if not explicitly disabled.

This patch fixes PR27706: https://llvm.org/bugs/show_bug.cgi?id=27706

Thanks rgoodfel@isi.edu for the catch.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@269585 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/CMakeLists.txt b/CMakeLists.txt
index abb1ffd..8460561 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -96,7 +96,8 @@
 set(ENABLE_LINKER_SCRIPT_DEFAULT_VALUE OFF)
 if (LLVM_HAVE_LINK_VERSION_SCRIPT AND NOT LIBCXX_ENABLE_STATIC_ABI_LIBRARY
       AND NOT LIBCXX_CXX_ABI_LIBNAME STREQUAL "none"
-      AND PYTHONINTERP_FOUND)
+      AND PYTHONINTERP_FOUND
+      AND LIBCXX_ENABLE_SHARED)
     set(ENABLE_LINKER_SCRIPT_DEFAULT_VALUE ON)
 endif()
 
@@ -203,6 +204,9 @@
     if (NOT PYTHONINTERP_FOUND)
       message(FATAL_ERROR "LIBCXX_ENABLE_ABI_LINKER_SCRIPT requires python but it was not found.")
     endif()
+    if (NOT LIBCXX_ENABLE_SHARED)
+      message(FATAL_ERROR "LIBCXX_ENABLE_ABI_LINKER_SCRIPT is only available for shared library builds.")
+    endif()
 endif()
 
 if (LIBCXX_ENABLE_STATIC_ABI_LIBRARY AND LIBCXX_ENABLE_ABI_LINKER_SCRIPT)