Add an off-by-default option to enable testing for gdb pretty printers.

The current version of the pretty printers are not python3 compatible,
so turn them off by default until sufficiently improved.

Reviewers: MaskRay, tamur

Subscribers: mgorny, christof, llvm-commits

Tags: #llvm

Differential Revision:

git-svn-id: 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d1a0658..335e7bc 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -81,6 +81,7 @@
 option(LIBCXX_INCLUDE_TESTS "Build the libc++ tests." ${LLVM_INCLUDE_TESTS})
 option(LIBCXX_ENABLE_PARALLEL_ALGORITHMS "Enable the parallel algorithms library. This requires the PSTL to be available." OFF)
+option(LIBCXX_TEST_GDB_PRETTY_PRINTERS "Test gdb pretty printers." OFF)
 # Benchmark options -----------------------------------------------------------
 option(LIBCXX_INCLUDE_BENCHMARKS "Build the libc++ benchmarks and their dependencies" ON)
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index e6ef628..8147451 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -60,12 +60,16 @@
   message(FATAL_ERROR "Expected LIBCXX_TEST_DEPS to be defined")
-find_program(LIBCXX_GDB gdb)
-  message(STATUS "gdb found: ${LIBCXX_GDB}")
-  message(STATUS "gdb not found. Disabling dependent tests.")
+# Turn this on by default when the pretty printers are python3
+# compatible.
+  find_program(LIBCXX_GDB gdb)
+  if (LIBCXX_GDB)
+    set(LIBCXX_GDB "${LIBCXX_GDB}")
+    message(STATUS "gdb found: ${LIBCXX_GDB}")
+  else()
+    message(STATUS "gdb not found. Disabling dependent tests.")
+  endif()