<p dir="ltr">Would you be able to supply the logs?</p>
<div class="gmail_quote">On Jul 29, 2015 5:50 PM, "Kostya Serebryany" <<a href="mailto:kcc@google.com">kcc@google.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I am seeing build failure when trying to run "ninja check-msan":<div><br></div><div><div>[39/58] Performing configure step for 'libcxx_msan-with-call'</div><div>FAILED: cd /usr/local/google/home/kcc/llvm-gcc-build/projects/compiler-rt/lib/msan/libcxx_msan-with-call/src/libcxx_msan-with-call-build && /usr/bin/cmake -P /usr/local/google/home/kcc/llvm-gcc-build/projects/compiler-rt/lib/msan/tests/../libcxx_msan-with-call/src/libcxx_msan-with-call-stamp/libcxx_msan-with-call-configure.cmake && /usr/bin/cmake -E touch /usr/local/google/home/kcc/llvm-gcc-build/projects/compiler-rt/lib/msan/tests/../libcxx_msan-with-call/src/libcxx_msan-with-call-stamp/libcxx_msan-with-call-configure</div><div>CMake Error at /usr/local/google/home/kcc/llvm-gcc-build/projects/compiler-rt/lib/msan/libcxx_msan-with-call/src/libcxx_msan-with-call-stamp/libcxx_msan-with-call-configure.cmake:16 (message):</div><div>  Command failed: 1</div><div><br></div><div>   '/usr/bin/cmake' '-DCMAKE_C_COMPILER=/usr/local/google/home/kcc/llvm-gcc-build/./bin/clang' '-DCMAKE_CXX_COMPILER=/usr/local/google/home/kcc/llvm-gcc-build/./bin/clang' '-DCMAKE_C_FLAGS= -fsanitize=memory -fsanitize-memory-track-origins -Wno-pedantic -fsanitize=memory -fsanitize-memory-track-origins -Wno-pedantic -mllvm -msan-instrumentation-with-call-threshold=0' '-DCMAKE_CXX_FLAGS= -fsanitize=memory -fsanitize-memory-track-origins -Wno-pedantic -fsanitize=memory -fsanitize-memory-track-origins -Wno-pedantic -mllvm -msan-instrumentation-with-call-threshold=0' '-DCMAKE_BUILD_TYPE=Release' '-DCMAKE_INSTALL_PREFIX:PATH=/usr/local/google/home/kcc/llvm-gcc-build/projects/compiler-rt/lib/msan/tests/../libcxx_msan-with-call' '-GNinja' '/usr/local/google/home/kcc/llvm/projects/libcxx'</div><div><br></div><div>  See also</div><div><br></div><div>    /usr/local/google/home/kcc/llvm-gcc-build/projects/compiler-rt/lib/msan/tests/../libcxx_msan-with-call/src/libcxx_msan-with-call-stamp/libcxx_msan-with-call-configure-*.log</div><div><br></div></div><div><br></div><div>Looks like this is the only change that might have caused this. </div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jul 29, 2015 at 2:07 PM, Eric Fiselier <span dir="ltr"><<a href="mailto:eric@efcs.ca" target="_blank">eric@efcs.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: ericwf<br>
Date: Wed Jul 29 16:07:28 2015<br>
New Revision: 243574<br>
<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject-3Frev-3D243574-26view-3Drev&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=BSqEv9KvKMW_Ob8SyngJ70KdZISM_ASROnREeq0cCxk&m=Ub_h1-I9qWSM9gqTpFPvCi_IvgC_XNe9Sp_21eCi7d0&s=P7fyWQXx6DaX9OUQxMROIF9f5907XRUcrLkG4usWWAo&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=243574&view=rev</a><br>
Log:<br>
Recommit r243503 "[libcxx] Cleanup CMake configuration and integrate with LLVM"<br>
<br>
This change was reverted in r243550 because it broke clang-format builds<br>
(see PR24306).<br>
<br>
This patch recommits a fixed version of the original.<br>
<br>
Added:<br>
    libcxx/trunk/cmake/Modules/FindLLVM.cmake<br>
    libcxx/trunk/cmake/Modules/HandleLibcxxFlags.cmake<br>
Modified:<br>
    libcxx/trunk/CMakeLists.txt<br>
    libcxx/trunk/cmake/Modules/HandleLibCXXABI.cmake<br>
    libcxx/trunk/cmake/config-ix.cmake<br>
    libcxx/trunk/lib/CMakeLists.txt<br>
    libcxx/trunk/test/CMakeLists.txt<br>
    libcxx/trunk/test/<a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__lit.site.cfg.in&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=BSqEv9KvKMW_Ob8SyngJ70KdZISM_ASROnREeq0cCxk&m=Ub_h1-I9qWSM9gqTpFPvCi_IvgC_XNe9Sp_21eCi7d0&s=2xnVpFEr0IGVL_WFM70QsG-_B1PcAQj7UzmuOZ1ysVU&e=" rel="noreferrer" target="_blank">lit.site.cfg.in</a><br>
    libcxx/trunk/www/index.html<br>
<br>
Modified: libcxx/trunk/CMakeLists.txt<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_libcxx_trunk_CMakeLists.txt-3Frev-3D243574-26r1-3D243573-26r2-3D243574-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=BSqEv9KvKMW_Ob8SyngJ70KdZISM_ASROnREeq0cCxk&m=Ub_h1-I9qWSM9gqTpFPvCi_IvgC_XNe9Sp_21eCi7d0&s=YfC7A4S9zW-y5k-43Vb0nBBH_8exuDJCSfDS3k-Mb-8&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/libcxx/trunk/CMakeLists.txt?rev=243574&r1=243573&r2=243574&view=diff</a><br>
==============================================================================<br>
--- libcxx/trunk/CMakeLists.txt (original)<br>
+++ libcxx/trunk/CMakeLists.txt Wed Jul 29 16:07:28 2015<br>
@@ -3,13 +3,16 @@<br>
 #===============================================================================<br>
 # Setup Project<br>
 #===============================================================================<br>
-<br>
-project(libcxx CXX C)<br>
 cmake_minimum_required(VERSION 2.8)<br>
<br>
 if(POLICY CMP0042)<br>
   cmake_policy(SET CMP0042 NEW) # Set MACOSX_RPATH=YES by default<br>
 endif()<br>
+if(POLICY CMP0022)<br>
+  cmake_policy(SET CMP0022 NEW) # Required when interacting with LLVM and Clang<br>
+endif()<br>
+<br>
+project(libcxx CXX C)<br>
<br>
 set(PACKAGE_NAME libcxx)<br>
 set(PACKAGE_VERSION trunk-svn)<br>
@@ -30,52 +33,90 @@ MACRO_ENSURE_OUT_OF_SOURCE_BUILD(<br>
  build directory and run 'cmake /path/to/${PROJECT_NAME} [options]' there."<br>
  )<br>
<br>
-if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)<br>
-  set(LIBCXX_LIBDIR_SUFFIX "" CACHE STRING<br>
-      "Define suffix of library directory name (32/64)")<br>
-<br>
-  set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib${LIBCXX_LIBDIR_SUFFIX})<br>
-  set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib${LIBCXX_LIBDIR_SUFFIX})<br>
-<br>
-  set(LIBCXX_BUILT_STANDALONE 1)<br>
-else()<br>
-  set(LIBCXX_LIBDIR_SUFFIX ${LLVM_LIBDIR_SUFFIX})<br>
-endif()<br>
+# Find the required bits of LLVM<br>
+include(FindLLVM)<br>
<br>
 #===============================================================================<br>
 # Setup CMake Options<br>
 #===============================================================================<br>
<br>
-# Define options.<br>
-option(LIBCXX_ENABLE_EXCEPTIONS "Use exceptions." ON)<br>
-option(LIBCXX_ENABLE_RTTI "Use run time type information." ON)<br>
+# Basic options ---------------------------------------------------------------<br>
 option(LIBCXX_ENABLE_ASSERTIONS "Enable assertions independent of build mode." ON)<br>
-option(LIBCXX_ENABLE_PEDANTIC "Compile with pedantic enabled." ON)<br>
-option(LIBCXX_ENABLE_WERROR "Fail and stop if a warning is triggered." OFF)<br>
-option(LIBCXX_ENABLE_CXX1Y "Enable -std=c++1y and use of c++1y language features if the compiler supports it." OFF)<br>
 option(LIBCXX_ENABLE_SHARED "Build libc++ as a shared library." ON)<br>
+<br>
+set(LIBCXX_LIBDIR_SUFFIX "${LLVM_LIBDIR_SUFFIX}" CACHE STRING<br>
+    "Define suffix of library directory name (32/64)")<br>
+option(LIBCXX_INSTALL_HEADERS "Install the libc++ headers." ON)<br>
+option(LIBCXX_INSTALL_SUPPORT_HEADERS "Install libc++ support headers." ON)<br>
+<br>
+# ABI Library options ---------------------------------------------------------<br>
+set(LIBCXX_CXX_ABI "${LIBCXX_CXX_ABI}" CACHE STRING<br>
+    "Specify C++ ABI library to use." FORCE)<br>
+set(CXXABIS none libcxxabi libcxxrt libstdc++ libsupc++)<br>
+set_property(CACHE LIBCXX_CXX_ABI PROPERTY STRINGS ;${CXXABIS})<br>
+<br>
+option(LIBCXX_ENABLE_STATIC_ABI_LIBRARY "Statically link the ABI library" OFF)<br>
+<br>
+# Build libc++abi with libunwind. We need this option to determine whether to<br>
+# link with libunwind or libgcc_s while running the test cases.<br>
+option(LIBCXXABI_USE_LLVM_UNWINDER "Build and use the LLVM unwinder." OFF)<br>
+<br>
+# Target options --------------------------------------------------------------<br>
+option(LIBCXX_BUILD_32_BITS "Build 32 bit libc++." OFF)<br>
+set(LIBCXX_SYSROOT "" CACHE STRING "Use alternate sysroot.")<br>
+set(LIBCXX_GCC_TOOLCHAIN "" CACHE STRING "Use alternate GCC toolchain.")<br>
+<br>
+# Feature options -------------------------------------------------------------<br>
+option(LIBCXX_ENABLE_EXCEPTIONS "Use exceptions." ON)<br>
+option(LIBCXX_ENABLE_RTTI "Use run time type information." ON)<br>
 option(LIBCXX_ENABLE_GLOBAL_FILESYSTEM_NAMESPACE "Build libc++ with support for the global filesystem namespace." ON)<br>
 option(LIBCXX_ENABLE_STDIN "Build libc++ with support for stdin/std::cin." ON)<br>
 option(LIBCXX_ENABLE_STDOUT "Build libc++ with support for stdout/std::cout." ON)<br>
 option(LIBCXX_ENABLE_THREADS "Build libc++ with support for threads." ON)<br>
 option(LIBCXX_ENABLE_THREAD_UNSAFE_C_FUNCTIONS "Build libc++ with support for thread-unsafe C functions" ON)<br>
-option(LIBCXX_BUILD_32_BITS "Build 32 bit libc++" OFF)<br>
 option(LIBCXX_ENABLE_MONOTONIC_CLOCK<br>
   "Build libc++ with support for a monotonic clock.<br>
    This option may only be used when LIBCXX_ENABLE_THREADS=OFF." ON)<br>
-option(LIBCXX_INSTALL_HEADERS "Install the libc++ headers." ON)<br>
-option(LIBCXX_INSTALL_SUPPORT_HEADERS "Install libc++ support headers." ON)<br>
+<br>
+# Misc options ----------------------------------------------------------------<br>
+option(LIBCXX_ENABLE_PEDANTIC "Compile with pedantic enabled." ON)<br>
+option(LIBCXX_ENABLE_WERROR "Fail and stop if a warning is triggered." OFF)<br>
+<br>
 option(LIBCXX_GENERATE_COVERAGE "Enable generating code coverage." OFF)<br>
 set(LIBCXX_COVERAGE_LIBRARY "" CACHE STRING<br>
-       "The Profile-rt library used to build with code coverage")<br>
-option(LIBCXX_ENABLE_STATIC_ABI_LIBRARY "Statically link the ABI library" OFF)<br>
-set(LIBCXX_SYSROOT "" CACHE STRING "Use alternate sysroot.")<br>
-set(LIBCXX_GCC_TOOLCHAIN "" CACHE STRING "Use alternate GCC toolchain.")<br>
-if (LIBCXX_BUILT_STANDALONE)<br>
-  set(LLVM_USE_SANITIZER "" CACHE STRING<br>
-      "Define the sanitizer used to build the library and tests")<br>
+    "The Profile-rt library used to build with code coverage")<br>
+<br>
+#===============================================================================<br>
+# Check option configurations<br>
+#===============================================================================<br>
+<br>
+# Ensure LIBCXX_ENABLE_MONOTONIC_CLOCK is set to ON only when<br>
+# LIBCXX_ENABLE_THREADS is on.<br>
+if(LIBCXX_ENABLE_THREADS AND NOT LIBCXX_ENABLE_MONOTONIC_CLOCK)<br>
+  message(FATAL_ERROR "LIBCXX_ENABLE_MONOTONIC_CLOCK can only be set to OFF"<br>
+                      " when LIBCXX_ENABLE_THREADS is also set to OFF.")<br>
+endif()<br>
+<br>
+# Ensure LLVM_USE_SANITIZER is not specified when LIBCXX_GENERATE_COVERAGE<br>
+# is ON.<br>
+if (LLVM_USE_SANITIZER AND LIBCXX_GENERATE_COVERAGE)<br>
+  message(FATAL_ERROR "LLVM_USE_SANITIZER cannot be used with LIBCXX_GENERATE_COVERAGE")<br>
+endif()<br>
+<br>
+# Set LIBCXX_BUILD_32_BITS to (LIBCXX_BUILD_32_BITS OR LLVM_BUILD_32_BITS)<br>
+# and check that we can build with 32 bits if requested.<br>
+if (CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT WIN32)<br>
+  if (LIBCXX_BUILD_32_BITS OR LLVM_BUILD_32_BITS)<br>
+    if (NOT LLVM_BUILD_32_BITS) # Don't duplicate the output from LLVM<br>
+      message(STATUS "Building 32 bits executables and libraries.")<br>
+    endif()<br>
+    set(LIBCXX_BUILD_32_BITS ON CACHE BOOL "" FORCE)<br>
+  endif()<br>
+elseif(LIBCXX_BUILD_32_BITS)<br>
+  message(FATAL_ERROR "LIBCXX_BUILD_32_BITS=ON is not supported on this platform.")<br>
 endif()<br>
<br>
+# Check that this option is not enabled on Apple and emit a usage warning.<br>
 if (LIBCXX_ENABLE_STATIC_ABI_LIBRARY)<br>
   if (APPLE)<br>
     message(FATAL_ERROR "LIBCXX_ENABLE_STATIC_ABI_LIBRARY is not supported on OS X")<br>
@@ -84,27 +125,6 @@ if (LIBCXX_ENABLE_STATIC_ABI_LIBRARY)<br>
   endif()<br>
 endif()<br>
<br>
-set(CXXABIS none libcxxabi libcxxrt libstdc++ libsupc++)<br>
-if (NOT LIBCXX_CXX_ABI)<br>
-  if (NOT DEFINED LIBCXX_BUILT_STANDALONE AND<br>
-      IS_DIRECTORY "${CMAKE_SOURCE_DIR}/projects/libcxxabi")<br>
-    set(LIBCXX_CXX_ABI_LIBNAME "libcxxabi")<br>
-    set(LIBCXX_CXX_ABI_INCLUDE_PATHS "${CMAKE_SOURCE_DIR}/projects/libcxxabi/include")<br>
-    set(LIBCXX_CXX_ABI_INTREE 1)<br>
-  else ()<br>
-    set(LIBCXX_CXX_ABI_LIBNAME "none")<br>
-  endif ()<br>
-else ()<br>
-  set(LIBCXX_CXX_ABI_LIBNAME "${LIBCXX_CXX_ABI}")<br>
-endif ()<br>
-set(LIBCXX_CXX_ABI "${LIBCXX_CXX_ABI}" CACHE STRING<br>
-    "Specify C++ ABI library to use." FORCE)<br>
-set_property(CACHE LIBCXX_CXX_ABI PROPERTY STRINGS ;${CXXABIS})<br>
-<br>
-# Build libc++abi with libunwind. We need this option to determine whether to<br>
-# link with libunwind or libgcc_s while running the test cases.<br>
-option(LIBCXXABI_USE_LLVM_UNWINDER "Build and use the LLVM unwinder." OFF)<br>
-<br>
 #===============================================================================<br>
 # Configure System<br>
 #===============================================================================<br>
@@ -114,234 +134,113 @@ set(LIBCXX_SOURCE_DIR  ${CMAKE_CURRENT_S<br>
 set(LIBCXX_BINARY_DIR  ${CMAKE_CURRENT_BINARY_DIR})<br>
 set(LIBCXX_LIBRARY_DIR ${CMAKE_BINARY_DIR}/lib${LIBCXX_LIBDIR_SUFFIX})<br>
<br>
+set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LIBCXX_LIBRARY_DIR})<br>
+set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${LIBCXX_LIBRARY_DIR})<br>
+<br>
 # Declare libc++ configuration variables.<br>
 # They are intended for use as follows:<br>
 # LIBCXX_CXX_FLAGS: General flags for both the compiler and linker.<br>
 # LIBCXX_COMPILE_FLAGS: Compile only flags.<br>
 # LIBCXX_LINK_FLAGS: Linker only flags.<br>
-set(LIBCXX_CXX_FLAGS "")<br>
 set(LIBCXX_COMPILE_FLAGS "")<br>
 set(LIBCXX_LINK_FLAGS "")<br>
+set(LIBCXX_LIBRARIES "")<br>
<br>
 # Configure compiler.<br>
 include(config-ix)<br>
-# Configure ABI library<br>
-include(HandleLibCXXABI)<br>
+<br>
 # Configure coverage options.<br>
 if (LIBCXX_GENERATE_COVERAGE)<br>
   include(CodeCoverage)<br>
   set(CMAKE_BUILD_TYPE "COVERAGE" CACHE STRING "" FORCE)<br>
 endif()<br>
<br>
+string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE)<br>
+<br>
 #===============================================================================<br>
 # Setup Compiler Flags<br>
 #===============================================================================<br>
<br>
-# Get required flags.<br>
-# On all systems the system c++ standard library headers need to be excluded.<br>
-if (MSVC)<br>
-  # MSVC only has -X, which disables all default includes; including the crt.<br>
-  # Thus, we do nothing and hope we don't accidentally include any of the C++<br>
-  # headers.<br>
-else()<br>
-  if (LIBCXX_HAS_NOSTDINCXX_FLAG)<br>
-    list(APPEND LIBCXX_COMPILE_FLAGS -nostdinc++)<br>
-    string(REPLACE "-stdlib=libc++" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")<br>
-    string(REPLACE "-stdlib=libstdc++" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")<br>
-  endif()<br>
-  # If c++1y has been enabled then attempt to use it. Fail if it is no supported<br>
-  # by the compiler. Otherwise choose c++11 and ensure the compiler supports it.<br>
-  if (LIBCXX_ENABLE_CXX1Y)<br>
-    if (LIBCXX_HAS_STDCXX1Y_FLAG)<br>
-      set(LIBCXX_STD_VERSION c++1y)<br>
-    else()<br>
-      message(FATAL_ERROR "c++1y was enabled but the compiler does not support it.")<br>
-    endif()<br>
-  else()<br>
-    if (LIBCXX_HAS_STDCXX11_FLAG)<br>
-      set(LIBCXX_STD_VERSION c++11)<br>
-    else()<br>
-      message(FATAL_ERROR "c++11 is required by libc++ but is not supported by the compiler")<br>
-    endif()<br>
-  endif()<br>
-  # LIBCXX_STD_VERSION should always be set at this point.<br>
-  list(APPEND LIBCXX_CXX_FLAGS "-std=${LIBCXX_STD_VERSION}")<br>
-endif()<br>
+include(HandleLibCXXABI) # Steup the ABI library flags<br>
<br>
-macro(append_if list condition var)<br>
-  if (${condition})<br>
-    list(APPEND ${list} ${var})<br>
-  endif()<br>
-endmacro()<br>
+# Include macros for adding and removing libc++ flags.<br>
+include(HandleLibcxxFlags)<br>
<br>
-# Get warning flags<br>
-# Disable the system header pragma.<br>
-add_definitions(-D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)<br>
-if (NOT MSVC)<br>
-  append_if(LIBCXX_COMPILE_FLAGS LIBCXX_HAS_WALL_FLAG -Wall)<br>
-  list(APPEND LIBCXX_COMPILE_FLAGS -Werror=return-type)<br>
+# Remove flags that may have snuck in.<br>
+remove_flags(-DNDEBUG -UNDEBUG -D_DEBUG<br>
+             -stdlib=libc++ -stdlib=libstdc++ -lc++abi -m32)<br>
+<br>
+# Required flags ==============================================================<br>
+add_compile_flags_if_supported(-std=c++11)<br>
+if (NOT MSVC AND NOT LIBCXX_SUPPORTS_STD_EQ_CXX11_FLAG)<br>
+  message(FATAL_ERROR "C++11 is required but the compiler does not support -std=c++11")<br>
 endif()<br>
<br>
-append_if(LIBCXX_COMPILE_FLAGS LIBCXX_HAS_W_FLAG -W)<br>
-append_if(LIBCXX_COMPILE_FLAGS LIBCXX_HAS_WNO_UNUSED_PARAMETER_FLAG -Wno-unused-parameter)<br>
-append_if(LIBCXX_COMPILE_FLAGS LIBCXX_HAS_WWRITE_STRINGS_FLAG -Wwrite-strings)<br>
-append_if(LIBCXX_COMPILE_FLAGS LIBCXX_HAS_WNO_LONG_LONG_FLAG -Wno-long-long)<br>
+# On all systems the system c++ standard library headers need to be excluded.<br>
+# MSVC only has -X, which disables all default includes; including the crt.<br>
+# Thus, we do nothing and hope we don't accidentally include any of the C++<br>
+# headers<br>
+add_compile_flags_if_supported(-nostdinc++)<br>
+<br>
+# Target flags ================================================================<br>
+add_flags_if(LIBCXX_BUILD_32_BITS -m32)<br>
+add_flags_if(LIBCXX_TARGET_TRIPLE "-target ${LIBCXX_TARGET_TRIPLE}")<br>
+add_flags_if(LIBCXX_SYSROOT "--sysroot ${LIBCXX_SYSROOT}")<br>
+add_flags_if(LIBCXX_GCC_TOOLCHAIN "-gcc-toolchain ${LIBCXX_GCC_TOOLCHAIN}")<br>
+<br>
+# Warning flags ===============================================================<br>
+add_definitions(-D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)<br>
+add_compile_flags_if_supported(<br>
+    -Wall -W -Wwrite-strings<br>
+    -Wno-unused-parameter -Wno-long-long<br>
+    -Werror=return-type)<br>
 if (LIBCXX_ENABLE_WERROR)<br>
-  append_if(LIBCXX_COMPILE_FLAGS LIBCXX_HAS_WERROR_FLAG -Werror)<br>
-  append_if(LIBCXX_COMPILE_FLAGS LIBCXX_HAS_WX_FLAG -WX)<br>
-else()<br>
-  append_if(LIBCXX_COMPILE_FLAGS LIBCXX_HAS_WNO_ERROR_FLAG -Wno-error)<br>
-  append_if(LIBCXX_COMPILE_FLAGS LIBCXX_HAS_NO_WX_FLAG -WX-)<br>
+  add_compile_flags_if_supported(-Werror)<br>
+  add_compile_flags_if_supported(-WX)<br>
 endif()<br>
 if (LIBCXX_ENABLE_PEDANTIC)<br>
-  append_if(LIBCXX_COMPILE_FLAGS LIBCXX_HAS_PEDANTIC_FLAG -pedantic)<br>
+  add_compile_flags_if_supported(-pedantic)<br>
 endif()<br>
<br>
-# Get feature flags.<br>
-# Exceptions<br>
+# Exception flags =============================================================<br>
 if (LIBCXX_ENABLE_EXCEPTIONS)<br>
   # Catches C++ exceptions only and tells the compiler to assume that extern C<br>
   # functions never throw a C++ exception.<br>
-  append_if(LIBCXX_CXX_FLAGS LIBCXX_HAS_EHSC_FLAG -EHsc)<br>
+  add_compile_flags_if_supported(-EHsc)<br>
 else()<br>
-  list(APPEND LIBCXX_CXX_FLAGS -D_LIBCPP_NO_EXCEPTIONS)<br>
-  append_if(LIBCXX_CXX_FLAGS LIBCXX_HAS_NO_EHS_FLAG -EHs-)<br>
-  append_if(LIBCXX_CXX_FLAGS LIBCXX_HAS_NO_EHA_FLAG -EHa-)<br>
-  append_if(LIBCXX_CXX_FLAGS LIBCXX_HAS_FNO_EXCEPTIONS_FLAG -fno-exceptions)<br>
+  add_definitions(-D_LIBCPP_NO_EXCEPTIONS)<br>
+  add_compile_flags_if_supported(-EHs- -EHa-)<br>
+  add_compile_flags_if_supported(-fno-exceptions)<br>
 endif()<br>
-# RTTI<br>
+<br>
+# RTTI flags ==================================================================<br>
 if (NOT LIBCXX_ENABLE_RTTI)<br>
-  list(APPEND LIBCXX_CXX_FLAGS -D_LIBCPP_NO_RTTI)<br>
-  append_if(LIBCXX_CXX_FLAGS LIBCXX_HAS_NO_GR_FLAG -GR-)<br>
-  append_if(LIBCXX_CXX_FLAGS LIBCXX_HAS_FNO_RTTI_FLAG -fno-rtti)<br>
+  add_definitions(-D_LIBCPP_NO_RTTI)<br>
+  add_compile_flags_if_supported(-GR-)<br>
+  add_compile_flags_if_supported(-fno-rtti)<br>
 endif()<br>
-# Assert<br>
-string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE)<br>
+<br>
+# Assertion flags =============================================================<br>
+define_if(LIBCXX_ENABLE_ASSERTIONS -UNDEBUG)<br>
+define_if_not(LIBCXX_ENABLE_ASSERTIONS -DNDEBUG)<br>
 if (LIBCXX_ENABLE_ASSERTIONS)<br>
   # MSVC doesn't like _DEBUG on release builds. See PR 4379.<br>
-  if (NOT MSVC)<br>
-    list(APPEND LIBCXX_COMPILE_FLAGS -D_DEBUG)<br>
-  endif()<br>
-  # On Release builds cmake automatically defines NDEBUG, so we<br>
-  # explicitly undefine it:<br>
-  if (uppercase_CMAKE_BUILD_TYPE STREQUAL "RELEASE")<br>
-    list(APPEND LIBCXX_COMPILE_FLAGS -UNDEBUG)<br>
-  endif()<br>
-else()<br>
-  if (NOT uppercase_CMAKE_BUILD_TYPE STREQUAL "RELEASE")<br>
-    list(APPEND LIBCXX_COMPILE_FLAGS -DNDEBUG)<br>
-  endif()<br>
-endif()<br>
-# Static library<br>
-if (NOT LIBCXX_ENABLE_SHARED)<br>
-  list(APPEND LIBCXX_COMPILE_FLAGS -D_LIBCPP_BUILD_STATIC)<br>
-endif()<br>
-<br>
-if (CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT WIN32)<br>
-  if (LIBCXX_BUILD_32_BITS)<br>
-    message(STATUS "Building 32 bits executables and libraries.")<br>
-    list(APPEND LIBCXX_CXX_FLAGS "-m32")<br>
-  endif()<br>
-elseif(LIBCXX_BUILD_32_BITS)<br>
-  message(FATAL_ERROR "LIBCXX_BUILD_32_BITS=ON is not supported on this platform.")<br>
-endif()<br>
-# This is the _ONLY_ place where add_definitions is called.<br>
-if (MSVC)<br>
-  add_definitions(-D_CRT_SECURE_NO_WARNINGS)<br>
-endif()<br>
-<br>
-# LIBCXX_ENABLE_GLOBAL_FILESYSTEM_NAMESPACE configuration<br>
-if (NOT LIBCXX_ENABLE_GLOBAL_FILESYSTEM_NAMESPACE)<br>
-  add_definitions(-D_LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE)<br>
-endif()<br>
-<br>
-# LIBCXX_ENABLE_STDIN configuration<br>
-if (NOT LIBCXX_ENABLE_STDIN)<br>
-  add_definitions(-D_LIBCPP_HAS_NO_STDIN)<br>
-endif()<br>
-<br>
-# LIBCXX_ENABLE_STDOUT configuration<br>
-if (NOT LIBCXX_ENABLE_STDOUT)<br>
-  add_definitions(-D_LIBCPP_HAS_NO_STDOUT)<br>
-endif()<br>
-<br>
-# LIBCXX_ENABLE_THREADS configuration<br>
-if (NOT LIBCXX_ENABLE_THREADS)<br>
-  add_definitions(-D_LIBCPP_HAS_NO_THREADS)<br>
-  if (NOT LIBCXX_ENABLE_MONOTONIC_CLOCK)<br>
-    add_definitions(-D_LIBCPP_HAS_NO_MONOTONIC_CLOCK)<br>
-  endif()<br>
-# Ensure LIBCXX_ENABLE_MONOTONIC_CLOCK is set to ON.<br>
-elseif(NOT LIBCXX_ENABLE_MONOTONIC_CLOCK)<br>
-  message(FATAL_ERROR "LIBCXX_ENABLE_MONOTONIC_CLOCK can only be set to OFF"<br>
-                      " when LIBCXX_ENABLE_THREADS is also set to OFF.")<br>
-endif()<br>
-<br>
-# LIBCXX_ENABLE_THREAD_UNSAFE_C_FUNCTIONS configuration<br>
-if (NOT LIBCXX_ENABLE_THREAD_UNSAFE_C_FUNCTIONS)<br>
-  add_definitions(-D_LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS)<br>
-endif()<br>
-<br>
-# Configure for sanitizers. If LIBCXX_BUILT_STANDALONE then we have to do<br>
-# the flag translation ourselves. Othewise LLVM's CMakeList.txt will handle it.<br>
-if (LIBCXX_BUILT_STANDALONE)<br>
-  # NOTE: LLVM_USE_SANITIZER checks for a UNIX like system instead of MSVC.<br>
-  # But we don't have LLVM_ON_UNIX so checking for MSVC is the best we can do.<br>
-  if (LLVM_USE_SANITIZER AND NOT MSVC)<br>
-    append_if(LIBCXX_CXX_FLAGS LIBCXX_HAS_FNO_OMIT_FRAME_POINTER_FLAG<br>
-              "-fno-omit-frame-pointer")<br>
-    if (NOT uppercase_CMAKE_BUILD_TYPE STREQUAL "DEBUG" AND<br>
-        NOT uppercase_CMAKE_BUILD_TYPE STREQUAL "RELWITHDEBINFO")<br>
-      append_if(LIBCXX_CXX_FLAGS LIBCXX_HAS_GLINE_TABLES_ONLY_FLAG<br>
-                "-gline-tables-only")<br>
-    endif()<br>
-    if (LLVM_USE_SANITIZER STREQUAL "Address")<br>
-      list(APPEND LIBCXX_CXX_FLAGS "-fsanitize=address")<br>
-    elseif (LLVM_USE_SANITIZER MATCHES "Memory(WithOrigins)?")<br>
-      list(APPEND LIBCXX_CXX_FLAGS "-fsanitize=memory")<br>
-      if (LLVM_USE_SANITIZER STREQUAL "MemoryWithOrigins")<br>
-        list(APPEND LIBCXX_CXX_FLAGS "-fsanitize-memory-track-origins")<br>
-      endif()<br>
-    elseif (LLVM_USE_SANITIZER STREQUAL "Undefined")<br>
-      list(APPEND LIBCXX_CXX_FLAGS<br>
-          "-fsanitize=undefined -fno-sanitize=vptr,function -fno-sanitize-recover")<br>
-    elseif (LLVM_USE_SANITIZER STREQUAL "Thread")<br>
-      list(APPEND LIBCXX_CXX_FLAGS "-fsanitize=thread")<br>
-    else()<br>
-      message(WARNING "Unsupported value of LLVM_USE_SANITIZER: ${LLVM_USE_SANITIZER}")<br>
-    endif()<br>
-  elseif(MSVC)<br>
-    message(WARNING "LLVM_USE_SANITIZER is not supported with MSVC")<br>
-  endif()<br>
-endif()<br>
-<br>
-append_if(LIBCXX_CXX_FLAGS LIBCXX_TARGET_TRIPLE<br>
-          "-target ${LIBCXX_TARGET_TRIPLE}")<br>
-<br>
-append_if(LIBCXX_CXX_FLAGS LIBCXX_SYSROOT "--sysroot ${LIBCXX_SYSROOT}")<br>
-append_if(LIBCXX_CXX_FLAGS LIBCXX_GCC_TOOLCHAIN<br>
-          "-gcc-toolchain ${LIBCXX_GCC_TOOLCHAIN}")<br>
-<br>
-if (LLVM_USE_SANITIZER AND LIBCXX_GENERATE_COVERAGE)<br>
-  message(FATAL_ERROR "LLVM_USE_SANITIZER cannot be used with LIBCXX_GENERATE_COVERAGE")<br>
+  define_if_not(MSVC -D_DEBUG)<br>
 endif()<br>
<br>
-string(REPLACE ";" " " LIBCXX_CXX_FLAGS "${LIBCXX_CXX_FLAGS}")<br>
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${LIBCXX_CXX_FLAGS}")<br>
+# Feature flags ===============================================================<br>
+define_if(MSVC -D_CRT_SECURE_NO_WARNINGS)<br>
+define_if_not(LIBCXX_ENABLE_GLOBAL_FILESYSTEM_NAMESPACE -D_LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE)<br>
+define_if_not(LIBCXX_ENABLE_STDIN -D_LIBCPP_HAS_NO_STDIN)<br>
+define_if_not(LIBCXX_ENABLE_STDOUT -D_LIBCPP_HAS_NO_STDOUT)<br>
+define_if_not(LIBCXX_ENABLE_THREADS -D_LIBCPP_HAS_NO_THREADS)<br>
+define_if_not(LIBCXX_ENABLE_MONOTONIC_CLOCK -D_LIBCPP_HAS_NO_MONOTONIC_CLOCK)<br>
+define_if_not(LIBCXX_ENABLE_THREAD_UNSAFE_C_FUNCTIONS -D_LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS)<br>
<br>
 #===============================================================================<br>
-# Setup Source Code<br>
+# Setup Source Code And Tests<br>
 #===============================================================================<br>
-<br>
 include_directories(include)<br>
 add_subdirectory(include)<br>
-<br>
-# Add source code. This also contains all of the logic for deciding linker flags<br>
-# soname, etc...<br>
 add_subdirectory(lib)<br>
-<br>
-#===============================================================================<br>
-# Setup Tests<br>
-#===============================================================================<br>
-<br>
 add_subdirectory(test)<br>
<br>
Added: libcxx/trunk/cmake/Modules/FindLLVM.cmake<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_libcxx_trunk_cmake_Modules_FindLLVM.cmake-3Frev-3D243574-26view-3Dauto&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=BSqEv9KvKMW_Ob8SyngJ70KdZISM_ASROnREeq0cCxk&m=Ub_h1-I9qWSM9gqTpFPvCi_IvgC_XNe9Sp_21eCi7d0&s=YIjfzT6P7tIVxNM5teE1buZreZRvFKRjM6MloBTEmdg&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/libcxx/trunk/cmake/Modules/FindLLVM.cmake?rev=243574&view=auto</a><br>
==============================================================================<br>
--- libcxx/trunk/cmake/Modules/FindLLVM.cmake (added)<br>
+++ libcxx/trunk/cmake/Modules/FindLLVM.cmake Wed Jul 29 16:07:28 2015<br>
@@ -0,0 +1,81 @@<br>
+<br>
+if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)<br>
+  # Rely on llvm-config.<br>
+  set(CONFIG_OUTPUT)<br>
+  find_program(LLVM_CONFIG "llvm-config")<br>
+  if(DEFINED LLVM_PATH)<br>
+    set(LLVM_INCLUDE_DIR ${LLVM_INCLUDE_DIR} CACHE PATH "Path to llvm/include")<br>
+    set(LLVM_PATH ${LLVM_PATH} CACHE PATH "Path to LLVM source tree")<br>
+    set(LLVM_MAIN_SRC_DIR ${LLVM_PATH})<br>
+    set(LLVM_CMAKE_PATH "${LLVM_PATH}/cmake/modules")<br>
+  elseif(LLVM_CONFIG)<br>
+    message(STATUS "Found LLVM_CONFIG as ${LLVM_CONFIG}")<br>
+    set(CONFIG_COMMAND ${LLVM_CONFIG}<br>
+      "--includedir"<br>
+      "--prefix"<br>
+      "--src-root")<br>
+    execute_process(<br>
+      COMMAND ${CONFIG_COMMAND}<br>
+      RESULT_VARIABLE HAD_ERROR<br>
+      OUTPUT_VARIABLE CONFIG_OUTPUT<br>
+    )<br>
+    if(NOT HAD_ERROR)<br>
+      string(REGEX REPLACE<br>
+        "[ \t]*[\r\n]+[ \t]*" ";"<br>
+        CONFIG_OUTPUT ${CONFIG_OUTPUT})<br>
+    else()<br>
+      string(REPLACE ";" " " CONFIG_COMMAND_STR "${CONFIG_COMMAND}")<br>
+      message(STATUS "${CONFIG_COMMAND_STR}")<br>
+      message(FATAL_ERROR "llvm-config failed with status ${HAD_ERROR}")<br>
+    endif()<br>
+<br>
+    list(GET CONFIG_OUTPUT 0 INCLUDE_DIR)<br>
+    list(GET CONFIG_OUTPUT 1 LLVM_OBJ_ROOT)<br>
+    list(GET CONFIG_OUTPUT 2 MAIN_SRC_DIR)<br>
+<br>
+    set(LLVM_INCLUDE_DIR ${INCLUDE_DIR} CACHE PATH "Path to llvm/include")<br>
+    set(LLVM_BINARY_DIR ${LLVM_OBJ_ROOT} CACHE PATH "Path to LLVM build tree")<br>
+    set(LLVM_MAIN_SRC_DIR ${MAIN_SRC_DIR} CACHE PATH "Path to LLVM source tree")<br>
+    set(LLVM_CMAKE_PATH "${LLVM_BINARY_DIR}/share/llvm/cmake")<br>
+  else()<br>
+    message(FATAL_ERROR "llvm-config not found and LLVM_MAIN_SRC_DIR not defined. "<br>
+                        "Reconfigure with -DLLVM_CONFIG=path/to/llvm-config "<br>
+                        "or -DLLVM_PATH=path/to/llvm-source-root.")<br>
+  endif()<br>
+<br>
+  if (NOT EXISTS ${LLVM_MAIN_SRC_DIR})<br>
+    message(FATAL_ERROR "Not found: ${LLVM_MAIN_SRC_DIR}")<br>
+  endif()<br>
+<br>
+  if(NOT EXISTS ${LLVM_CMAKE_PATH})<br>
+    message(FATAL_ERROR "Not found: ${LLVM_CMAKE_PATH}")<br>
+  endif()<br>
+<br>
+  list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_PATH}")<br>
+  list(APPEND CMAKE_MODULE_PATH "${LLVM_MAIN_SRC_DIR}/cmake/modules")<br>
+<br>
+<br>
+  if(LLVM_LIT)<br>
+    # Define the default arguments to use with 'lit', and an option for the user<br>
+    # to override.<br>
+    set(LIT_ARGS_DEFAULT "-sv --show-xfail --show-unsupported")<br>
+    if (MSVC OR XCODE)<br>
+      set(LIT_ARGS_DEFAULT "${LIT_ARGS_DEFAULT} --no-progress-bar")<br>
+    endif()<br>
+    set(LLVM_LIT_ARGS "${LIT_ARGS_DEFAULT}" CACHE STRING "Default options for lit")<br>
+<br>
+    # On Win32 hosts, provide an option to specify the path to the GnuWin32 tools.<br>
+    if( WIN32 AND NOT CYGWIN )<br>
+      set(LLVM_LIT_TOOLS_DIR "" CACHE PATH "Path to GnuWin32 tools")<br>
+    endif()<br>
+  else()<br>
+    set(LLVM_INCLUDE_TESTS OFF)<br>
+  endif()<br>
+<br>
+  include(AddLLVM) # Include the LLVM CMake functions.<br>
+  include(HandleLLVMOptions)<br>
+  set(LIBCXX_BUILT_STANDALONE 1)<br>
+else()<br>
+  set(LLVM_MAIN_SRC_DIR "${CMAKE_SOURCE_DIR}" CACHE PATH "Path to LLVM source tree")<br>
+  set(LLVM_LIT "${CMAKE_SOURCE_DIR}/utils/lit/lit.py")<br>
+endif()<br>
<br>
Modified: libcxx/trunk/cmake/Modules/HandleLibCXXABI.cmake<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_libcxx_trunk_cmake_Modules_HandleLibCXXABI.cmake-3Frev-3D243574-26r1-3D243573-26r2-3D243574-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=BSqEv9KvKMW_Ob8SyngJ70KdZISM_ASROnREeq0cCxk&m=Ub_h1-I9qWSM9gqTpFPvCi_IvgC_XNe9Sp_21eCi7d0&s=UMOjZrZ6Ign5K3AuvyD7XJyeiR5e3BeWQXu7VcdPClg&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/libcxx/trunk/cmake/Modules/HandleLibCXXABI.cmake?rev=243574&r1=243573&r2=243574&view=diff</a><br>
==============================================================================<br>
--- libcxx/trunk/cmake/Modules/HandleLibCXXABI.cmake (original)<br>
+++ libcxx/trunk/cmake/Modules/HandleLibCXXABI.cmake Wed Jul 29 16:07:28 2015<br>
@@ -58,6 +58,21 @@ macro(setup_abi_lib abidefines abilib ab<br>
<br>
 endmacro()<br>
<br>
+# Setup the default options if LIBCXX_CXX_ABI is not specified.<br>
+if (NOT LIBCXX_CXX_ABI)<br>
+  if (NOT DEFINED LIBCXX_BUILT_STANDALONE AND<br>
+      IS_DIRECTORY "${CMAKE_SOURCE_DIR}/projects/libcxxabi")<br>
+    set(LIBCXX_CXX_ABI_LIBNAME "libcxxabi")<br>
+    set(LIBCXX_CXX_ABI_INCLUDE_PATHS "${CMAKE_SOURCE_DIR}/projects/libcxxabi/include")<br>
+    set(LIBCXX_CXX_ABI_INTREE 1)<br>
+  else ()<br>
+    set(LIBCXX_CXX_ABI_LIBNAME "none")<br>
+  endif ()<br>
+else ()<br>
+  set(LIBCXX_CXX_ABI_LIBNAME "${LIBCXX_CXX_ABI}")<br>
+endif ()<br>
+<br>
+# Configure based on the selected ABI library.<br>
 if ("${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL "libstdc++" OR<br>
     "${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL "libsupc++")<br>
   set(_LIBSUPCXX_INCLUDE_FILES<br>
<br>
Added: libcxx/trunk/cmake/Modules/HandleLibcxxFlags.cmake<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_libcxx_trunk_cmake_Modules_HandleLibcxxFlags.cmake-3Frev-3D243574-26view-3Dauto&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=BSqEv9KvKMW_Ob8SyngJ70KdZISM_ASROnREeq0cCxk&m=Ub_h1-I9qWSM9gqTpFPvCi_IvgC_XNe9Sp_21eCi7d0&s=xAUgFxYaPpDboiVQfEZNS6UtxykK6gt7J4MCyUqFnt0&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/libcxx/trunk/cmake/Modules/HandleLibcxxFlags.cmake?rev=243574&view=auto</a><br>
==============================================================================<br>
--- libcxx/trunk/cmake/Modules/HandleLibcxxFlags.cmake (added)<br>
+++ libcxx/trunk/cmake/Modules/HandleLibcxxFlags.cmake Wed Jul 29 16:07:28 2015<br>
@@ -0,0 +1,147 @@<br>
+# HandleLibcxxFlags - A set of macros used to setup the flags used to compile<br>
+# and link libc++. These macros add flags to the following CMake variables.<br>
+# - LIBCXX_COMPILE_FLAGS: flags used to compile libc++<br>
+# - LIBCXX_LINK_FLAGS: flags used to link libc++<br>
+# - LIBCXX_LIBRARIES: libraries to link libc++ to.<br>
+<br>
+include(CheckCXXCompilerFlag)<br>
+<br>
+unset(add_flag_if_supported)<br>
+<br>
+# Mangle the name of a compiler flag into a valid CMake identifier.<br>
+# Ex: --std=c++11 -> STD_EQ_CXX11<br>
+macro(mangle_name str output)<br>
+  string(STRIP "${str}" strippedStr)<br>
+  string(REGEX REPLACE "^/" "" strippedStr "${strippedStr}")<br>
+  string(REGEX REPLACE "^-+" "" strippedStr "${strippedStr}")<br>
+  string(REGEX REPLACE "-+$" "" strippedStr "${strippedStr}")<br>
+  string(REPLACE "-" "_" strippedStr "${strippedStr}")<br>
+  string(REPLACE "=" "_EQ_" strippedStr "${strippedStr}")<br>
+  string(REPLACE "+" "X" strippedStr "${strippedStr}")<br>
+  string(TOUPPER "${strippedStr}" ${output})<br>
+endmacro()<br>
+<br>
+# Remove a list of flags from all CMake variables that affect compile flags.<br>
+# This can be used to remove unwanted flags specified on the command line<br>
+# or added in other parts of LLVM's cmake configuration.<br>
+macro(remove_flags)<br>
+  foreach(var ${ARGN})<br>
+    string(REPLACE "${var}" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")<br>
+    string(REPLACE "${var}" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")<br>
+    string(REPLACE "${var}" "" CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}")<br>
+    string(REPLACE "${var}" "" CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}")<br>
+    string(REPLACE "${var}" "" CMAKE_SHARED_MODULE_FLAGS "${CMAKE_SHARED_MODULE_FLAGS}")<br>
+    remove_definitions(${var})<br>
+  endforeach()<br>
+endmacro(remove_flags)<br>
+<br>
+# Add a macro definition if condition is true.<br>
+macro(define_if condition def)<br>
+  if (${condition})<br>
+    add_definitions(${def})<br>
+  endif()<br>
+endmacro()<br>
+<br>
+# Add a macro definition if condition is not true.<br>
+macro(define_if_not condition def)<br>
+  if (NOT ${condition})<br>
+    add_definitions(${def})<br>
+  endif()<br>
+endmacro()<br>
+<br>
+# Add a specified list of flags to both 'LIBCXX_COMPILE_FLAGS' and<br>
+# 'LIBCXX_LINK_FLAGS'.<br>
+macro(add_flags)<br>
+  foreach(value ${ARGN})<br>
+    list(APPEND LIBCXX_COMPILE_FLAGS ${value})<br>
+    list(APPEND LIBCXX_LINK_FLAGS ${value})<br>
+  endforeach()<br>
+endmacro()<br>
+<br>
+# If the specified 'condition' is true then add a list of flags to both<br>
+# 'LIBCXX_COMPILE_FLAGS' and 'LIBCXX_LINK_FLAGS'.<br>
+macro(add_flags_if condition)<br>
+  if (${condition})<br>
+    add_flags(${ARGN})<br>
+  endif()<br>
+endmacro()<br>
+<br>
+# Add each flag in the list to LIBCXX_COMPILE_FLAGS and LIBCXX_LINK_FLAGS<br>
+# if that flag is supported by the current compiler.<br>
+macro(add_flags_if_supported)<br>
+  foreach(flag ${ARGN})<br>
+      mangle_name("${flag}" flagname)<br>
+      check_cxx_compiler_flag("${flag}" "LIBCXX_SUPPORTS_${flagname}_FLAG")<br>
+      add_flags_if(LIBCXX_SUPPORTS_${flagname}_FLAG ${flag})<br>
+  endforeach()<br>
+endmacro()<br>
+<br>
+# Add a list of flags to 'LIBCXX_COMPILE_FLAGS'.<br>
+macro(add_compile_flags)<br>
+  foreach(f ${ARGN})<br>
+    list(APPEND LIBCXX_COMPILE_FLAGS ${f})<br>
+  endforeach()<br>
+endmacro()<br>
+<br>
+# If 'condition' is true then add the specified list of flags to<br>
+# 'LIBCXX_COMPILE_FLAGS'<br>
+macro(add_compile_flags_if condition)<br>
+  if (${condition})<br>
+    add_compile_flags(${ARGN})<br>
+  endif()<br>
+endmacro()<br>
+<br>
+# For each specified flag, add that flag to 'LIBCXX_COMPILE_FLAGS' if the<br>
+# flag is supported by the C++ compiler.<br>
+macro(add_compile_flags_if_supported)<br>
+  foreach(flag ${ARGN})<br>
+      mangle_name("${flag}" flagname)<br>
+      check_cxx_compiler_flag("-Werror ${flag}" "LIBCXX_SUPPORTS_${flagname}_FLAG")<br>
+      add_compile_flags_if(LIBCXX_SUPPORTS_${flagname}_FLAG ${flag})<br>
+  endforeach()<br>
+endmacro()<br>
+<br>
+# Add a list of flags to 'LIBCXX_LINK_FLAGS'.<br>
+macro(add_link_flags)<br>
+  foreach(f ${ARGN})<br>
+    list(APPEND LIBCXX_LINK_FLAGS ${f})<br>
+  endforeach()<br>
+endmacro()<br>
+<br>
+# If 'condition' is true then add the specified list of flags to<br>
+# 'LIBCXX_LINK_FLAGS'<br>
+macro(add_link_flags_if condition)<br>
+  if (${condition})<br>
+    add_link_flags(${ARGN})<br>
+  endif()<br>
+endmacro()<br>
+<br>
+# For each specified flag, add that flag to 'LIBCXX_LINK_FLAGS' if the<br>
+# flag is supported by the C++ compiler.<br>
+macro(add_link_flags_if_supported)<br>
+  foreach(flag ${ARGN})<br>
+    mangle_name("${flag}" flagname)<br>
+    check_cxx_compiler_flag("${flag}" "LIBCXX_SUPPORTS_${flagname}_FLAG")<br>
+    add_link_flags_if(LIBCXX_SUPPORTS_${flagname}_FLAG ${flag})<br>
+  endforeach()<br>
+endmacro()<br>
+<br>
+# Add a list of libraries or link flags to 'LIBCXX_LIBRARIES'.<br>
+macro(add_library_flags)<br>
+  foreach(lib ${ARGN})<br>
+    list(APPEND LIBCXX_LIBRARIES ${lib})<br>
+  endforeach()<br>
+endmacro()<br>
+<br>
+# if 'condition' is true then add the specified list of libraries and flags<br>
+# to 'LIBCXX_LIBRARIES'.<br>
+macro(add_library_flags_if condition)<br>
+  if(${condition})<br>
+    add_library_flags(${ARGN})<br>
+  endif()<br>
+endmacro()<br>
+<br>
+# Turn a comma separated CMake list into a space separated string.<br>
+macro(split_list listname)<br>
+  string(REPLACE ";" " " ${listname} "${${listname}}")<br>
+endmacro()<br>
<br>
Modified: libcxx/trunk/cmake/config-ix.cmake<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_libcxx_trunk_cmake_config-2Dix.cmake-3Frev-3D243574-26r1-3D243573-26r2-3D243574-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=BSqEv9KvKMW_Ob8SyngJ70KdZISM_ASROnREeq0cCxk&m=Ub_h1-I9qWSM9gqTpFPvCi_IvgC_XNe9Sp_21eCi7d0&s=cBKtbzUmJioIOoOcHBjzFtFqw9pCJUWRjJi6aLLnw_c&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/libcxx/trunk/cmake/config-ix.cmake?rev=243574&r1=243573&r2=243574&view=diff</a><br>
==============================================================================<br>
--- libcxx/trunk/cmake/config-ix.cmake (original)<br>
+++ libcxx/trunk/cmake/config-ix.cmake Wed Jul 29 16:07:28 2015<br>
@@ -2,23 +2,7 @@ include(CheckLibraryExists)<br>
 include(CheckCXXCompilerFlag)<br>
<br>
 # Check compiler flags<br>
-check_cxx_compiler_flag(-std=c++11              LIBCXX_HAS_STDCXX11_FLAG)<br>
-check_cxx_compiler_flag(-std=c++1y              LIBCXX_HAS_STDCXX1Y_FLAG)<br>
-check_cxx_compiler_flag(-fPIC                   LIBCXX_HAS_FPIC_FLAG)<br>
-check_cxx_compiler_flag(-fno-omit-frame-pointer LIBCXX_HAS_FNO_OMIT_FRAME_POINTER_FLAG)<br>
-check_cxx_compiler_flag(-nodefaultlibs          LIBCXX_HAS_NODEFAULTLIBS_FLAG)<br>
-check_cxx_compiler_flag(-nostdinc++             LIBCXX_HAS_NOSTDINCXX_FLAG)<br>
-check_cxx_compiler_flag(-Wall                   LIBCXX_HAS_WALL_FLAG)<br>
-check_cxx_compiler_flag(-W                      LIBCXX_HAS_W_FLAG)<br>
-check_cxx_compiler_flag(-Wno-unused-parameter   LIBCXX_HAS_WNO_UNUSED_PARAMETER_FLAG)<br>
-check_cxx_compiler_flag(-Wwrite-strings         LIBCXX_HAS_WWRITE_STRINGS_FLAG)<br>
-check_cxx_compiler_flag(-Wno-long-long          LIBCXX_HAS_WNO_LONG_LONG_FLAG)<br>
-check_cxx_compiler_flag(-pedantic               LIBCXX_HAS_PEDANTIC_FLAG)<br>
-check_cxx_compiler_flag(-Werror                 LIBCXX_HAS_WERROR_FLAG)<br>
-check_cxx_compiler_flag(-Wno-error              LIBCXX_HAS_WNO_ERROR_FLAG)<br>
-check_cxx_compiler_flag(-fno-exceptions         LIBCXX_HAS_FNO_EXCEPTIONS_FLAG)<br>
-check_cxx_compiler_flag(-fno-rtti               LIBCXX_HAS_FNO_RTTI_FLAG)<br>
-check_cxx_compiler_flag(-gline-tables-only      LIBCXX_HAS_GLINE_TABLES_ONLY_FLAG)<br>
+<br>
 check_cxx_compiler_flag(/WX                     LIBCXX_HAS_WX_FLAG)<br>
 check_cxx_compiler_flag(/WX-                    LIBCXX_HAS_NO_WX_FLAG)<br>
 check_cxx_compiler_flag(/EHsc                   LIBCXX_HAS_EHSC_FLAG)<br>
@@ -26,6 +10,7 @@ check_cxx_compiler_flag(/EHs-<br>
 check_cxx_compiler_flag(/EHa-                   LIBCXX_HAS_NO_EHA_FLAG)<br>
 check_cxx_compiler_flag(/GR-                    LIBCXX_HAS_NO_GR_FLAG)<br>
<br>
+<br>
 # Check libraries<br>
 check_library_exists(pthread pthread_create "" LIBCXX_HAS_PTHREAD_LIB)<br>
 check_library_exists(c printf "" LIBCXX_HAS_C_LIB)<br>
<br>
Modified: libcxx/trunk/lib/CMakeLists.txt<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_libcxx_trunk_lib_CMakeLists.txt-3Frev-3D243574-26r1-3D243573-26r2-3D243574-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=BSqEv9KvKMW_Ob8SyngJ70KdZISM_ASROnREeq0cCxk&m=Ub_h1-I9qWSM9gqTpFPvCi_IvgC_XNe9Sp_21eCi7d0&s=bKPBLKwQd1G3gx24_EHB83_sNchufN5hSdouKyCn2sE&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/libcxx/trunk/lib/CMakeLists.txt?rev=243574&r1=243573&r2=243574&view=diff</a><br>
==============================================================================<br>
--- libcxx/trunk/lib/CMakeLists.txt (original)<br>
+++ libcxx/trunk/lib/CMakeLists.txt Wed Jul 29 16:07:28 2015<br>
@@ -25,48 +25,23 @@ if (MSVC_IDE OR XCODE)<br>
 endif()<br>
<br>
 if (LIBCXX_ENABLE_SHARED)<br>
-  add_library(cxx SHARED<br>
-    ${LIBCXX_SOURCES}<br>
-    ${LIBCXX_HEADERS}<br>
-    )<br>
+  add_library(cxx SHARED ${LIBCXX_SOURCES} ${LIBCXX_HEADERS})<br>
 else()<br>
-  add_library(cxx STATIC<br>
-    ${LIBCXX_SOURCES}<br>
-    ${LIBCXX_HEADERS}<br>
-    )<br>
-endif()<br>
-<br>
-#if LIBCXX_CXX_ABI_LIBRARY_PATH is defined we want to add it to the search path.<br>
-if (DEFINED LIBCXX_CXX_ABI_LIBRARY_PATH)<br>
-  target_link_libraries(cxx "-L${LIBCXX_CXX_ABI_LIBRARY_PATH}")<br>
+  add_library(cxx STATIC ${LIBCXX_SOURCES} ${LIBCXX_HEADERS})<br>
 endif()<br>
<br>
 if (DEFINED LIBCXX_CXX_ABI_DEPS)<br>
   add_dependencies(cxx LIBCXX_CXX_ABI_DEPS)<br>
 endif()<br>
<br>
-set(libraries "")<br>
-if (LIBCXX_ENABLE_STATIC_ABI_LIBRARY)<br>
-    # TODO(ericwf): Remove these GNU specific linker flags and let CMake do the<br>
-    # configuration. This will be more portable.<br>
-    list(APPEND libraries "-Wl,--whole-archive" "-Wl,-Bstatic")<br>
-    list(APPEND libraries "${LIBCXX_CXX_ABI_LIBRARY}")<br>
-    list(APPEND libraries "-Wl,-Bdynamic" "-Wl,--no-whole-archive")<br>
-else()<br>
-    list(APPEND libraries "${LIBCXX_CXX_ABI_LIBRARY}")<br>
-endif()<br>
+#if LIBCXX_CXX_ABI_LIBRARY_PATH is defined we want to add it to the search path.<br>
+add_link_flags_if(LIBCXX_CXX_ABI_LIBRARY_PATH "-L${LIBCXX_CXX_ABI_LIBRARY_PATH}")<br>
<br>
-# Generate library list.<br>
-append_if(libraries LIBCXX_HAS_PTHREAD_LIB pthread)<br>
-append_if(libraries LIBCXX_HAS_C_LIB c)<br>
-append_if(libraries LIBCXX_HAS_M_LIB m)<br>
-append_if(libraries LIBCXX_HAS_RT_LIB rt)<br>
-append_if(libraries LIBCXX_HAS_GCC_S_LIB gcc_s)<br>
+add_library_flags_if(LIBCXX_COVERAGE_LIBRARY "${LIBCXX_COVERAGE_LIBRARY}")<br>
<br>
-if (LIBCXX_COVERAGE_LIBRARY)<br>
-  target_link_libraries(cxx ${LIBCXX_COVERAGE_LIBRARY})<br>
-endif()<br>
-target_link_libraries(cxx ${libraries})<br>
+add_library_flags_if(LIBCXX_ENABLE_STATIC_ABI_LIBRARY "-Wl,--whole-archive" "-Wl,-Bstatic")<br>
+add_library_flags("${LIBCXX_CXX_ABI_LIBRARY}")<br>
+add_library_flags_if(LIBCXX_ENABLE_STATIC_ABI_LIBRARY "-Wl,-Bdynamic" "-Wl,--no-whole-archive")<br>
<br>
 if (APPLE AND LLVM_USE_SANITIZER)<br>
   if ("${LLVM_USE_SANITIZER}" STREQUAL "Address")<br>
@@ -89,15 +64,21 @@ if (APPLE AND LLVM_USE_SANITIZER)<br>
     set(LIBCXX_SANITIZER_LIBRARY "${LIBDIR}/${LIBFILE}")<br>
     set(LIBCXX_SANITIZER_LIBRARY "${LIBCXX_SANITIZER_LIBRARY}" PARENT_SCOPE)<br>
     message(STATUS "Manually linking compiler-rt library: ${LIBCXX_SANITIZER_LIBRARY}")<br>
-    target_link_libraries(cxx "${LIBCXX_SANITIZER_LIBRARY}")<br>
-    target_link_libraries(cxx "-Wl,-rpath,${LIBDIR}")<br>
+    add_library_flags("${LIBCXX_SANITIZER_LIBRARY}")<br>
+    add_link_flags("-Wl,-rpath,${LIBDIR}")<br>
   endif()<br>
 endif()<br>
<br>
+# Generate library list.<br>
+add_library_flags_if(LIBCXX_HAS_PTHREAD_LIB pthread)<br>
+add_library_flags_if(LIBCXX_HAS_C_LIB c)<br>
+add_library_flags_if(LIBCXX_HAS_M_LIB m)<br>
+add_library_flags_if(LIBCXX_HAS_RT_LIB rt)<br>
+add_library_flags_if(LIBCXX_HAS_GCC_S_LIB gcc_s)<br>
<br>
 # Setup flags.<br>
-append_if(LIBCXX_COMPILE_FLAGS LIBCXX_HAS_FPIC_FLAG -fPIC)<br>
-append_if(LIBCXX_LINK_FLAGS LIBCXX_HAS_NODEFAULTLIBS_FLAG -nodefaultlibs)<br>
+add_flags_if_supported(-fPIC)<br>
+add_link_flags_if_supported(-nodefaultlibs)<br>
<br>
 if ( APPLE AND (LIBCXX_CXX_ABI_LIBNAME STREQUAL "libcxxabi" OR<br>
                 LIBCXX_CXX_ABI_LIBNAME STREQUAL "none"))<br>
@@ -106,8 +87,8 @@ if ( APPLE AND (LIBCXX_CXX_ABI_LIBNAME S<br>
   endif()<br>
<br>
   if ( CMAKE_OSX_DEPLOYMENT_TARGET STREQUAL "10.6" )<br>
-    list(APPEND LIBCXX_COMPILE_FLAGS "-U__STRICT_ANSI__")<br>
-    list(APPEND LIBCXX_LINK_FLAGS<br>
+    add_definitions(-D__STRICT_ANSI__)<br>
+    add_link_flags(<br>
       "-compatibility_version 1"<br>
       "-current_version 1"<br>
       "-install_name /usr/lib/libc++.1.dylib"<br>
@@ -129,7 +110,7 @@ if ( APPLE AND (LIBCXX_CXX_ABI_LIBNAME S<br>
       set (OSX_RE_EXPORT_LINE "/usr/lib/libc++abi.dylib -Wl,-reexported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/libc++abi${LIBCXX_LIBCPPABI_VERSION}.exp")<br>
     endif()<br>
<br>
-    list(APPEND LIBCXX_LINK_FLAGS<br>
+    add_link_flags(<br>
       "-compatibility_version 1"<br>
       "-install_name /usr/lib/libc++.1.dylib"<br>
       "-Wl,-unexported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/libc++unexp.exp"<br>
@@ -139,8 +120,9 @@ if ( APPLE AND (LIBCXX_CXX_ABI_LIBNAME S<br>
   endif()<br>
 endif()<br>
<br>
-string(REPLACE ";" " " LIBCXX_COMPILE_FLAGS "${LIBCXX_COMPILE_FLAGS}")<br>
-string(REPLACE ";" " " LIBCXX_LINK_FLAGS "${LIBCXX_LINK_FLAGS}")<br>
+target_link_libraries(cxx ${LIBCXX_LIBRARIES})<br>
+split_list(LIBCXX_COMPILE_FLAGS)<br>
+split_list(LIBCXX_LINK_FLAGS)<br>
<br>
 set_target_properties(cxx<br>
   PROPERTIES<br>
<br>
Modified: libcxx/trunk/test/CMakeLists.txt<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_libcxx_trunk_test_CMakeLists.txt-3Frev-3D243574-26r1-3D243573-26r2-3D243574-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=BSqEv9KvKMW_Ob8SyngJ70KdZISM_ASROnREeq0cCxk&m=Ub_h1-I9qWSM9gqTpFPvCi_IvgC_XNe9Sp_21eCi7d0&s=l4pj0HS8gNxp0qmNTURhCg7KlIAftWSyfL0rx-d8fJI&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/CMakeLists.txt?rev=243574&r1=243573&r2=243574&view=diff</a><br>
==============================================================================<br>
--- libcxx/trunk/test/CMakeLists.txt (original)<br>
+++ libcxx/trunk/test/CMakeLists.txt Wed Jul 29 16:07:28 2015<br>
@@ -6,84 +6,47 @@ macro(pythonize_bool var)<br>
   endif()<br>
 endmacro()<br>
<br>
-set(LIT_EXECUTABLE "" CACHE FILEPATH "Path to LLVM's llvm-lit.")<br>
+set(LIBCXX_LIT_VARIANT "libcxx" CACHE STRING<br>
+    "Configuration variant to use for LIT.")<br>
<br>
-if(LIBCXX_BUILT_STANDALONE)<br>
-  # Make sure we can use the console pool for recent cmake and ninja > 1.5<br>
-  if(CMAKE_VERSION VERSION_LESS 3.1.20141117)<br>
-    set(cmake_3_2_USES_TERMINAL)<br>
-  else()<br>
-    set(cmake_3_2_USES_TERMINAL USES_TERMINAL)<br>
-  endif()<br>
-else()<br>
-  include(FindPythonInterp)<br>
-  if(PYTHONINTERP_FOUND)<br>
-    set(LIT_EXECUTABLE<br>
-        ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/utils/lit/lit.py)<br>
-  else()<br>
-    message(WARNING "Could not find Python, cannot set LIT_EXECUTABLE.")<br>
-  endif()<br>
+pythonize_bool(LIBCXX_ENABLE_EXCEPTIONS)<br>
+pythonize_bool(LIBCXX_ENABLE_RTTI)<br>
+pythonize_bool(LIBCXX_ENABLE_SHARED)<br>
+pythonize_bool(LIBCXX_BUILD_32_BITS)<br>
+pythonize_bool(LIBCXX_ENABLE_GLOBAL_FILESYSTEM_NAMESPACE)<br>
+pythonize_bool(LIBCXX_ENABLE_STDIN)<br>
+pythonize_bool(LIBCXX_ENABLE_STDOUT)<br>
+pythonize_bool(LIBCXX_ENABLE_THREADS)<br>
+pythonize_bool(LIBCXX_ENABLE_THREAD_UNSAFE_C_FUNCTIONS)<br>
+pythonize_bool(LIBCXX_ENABLE_MONOTONIC_CLOCK)<br>
+pythonize_bool(LIBCXX_GENERATE_COVERAGE)<br>
+pythonize_bool(LIBCXXABI_USE_LLVM_UNWINDER)<br>
+<br>
+# The tests shouldn't link to any ABI library when it has been linked into<br>
+# libc++ statically.<br>
+if (LIBCXX_ENABLE_STATIC_ABI_LIBRARY)<br>
+  set(LIBCXX_CXX_ABI_LIBNAME "none")<br>
 endif()<br>
-<br>
-if (LIT_EXECUTABLE)<br>
-  set(LIT_ARGS_DEFAULT "-sv --show-unsupported --show-xfail")<br>
-  if (MSVC OR XCODE)<br>
-    set(LIT_ARGS_DEFAULT "${LIT_ARGS_DEFAULT} --no-progress-bar")<br>
-  endif()<br>
-  set(LLVM_LIT_ARGS "${LIT_ARGS_DEFAULT}"<br>
-      CACHE STRING "Default options for lit")<br>
-  set(LIT_ARGS "${LLVM_LIT_ARGS}")<br>
-  separate_arguments(LIT_ARGS)<br>
-<br>
-  set(LIBCXX_LIT_VARIANT "libcxx" CACHE STRING<br>
-      "Configuration variant to use for LIT.")<br>
-<br>
-  pythonize_bool(LIBCXX_ENABLE_EXCEPTIONS)<br>
-  pythonize_bool(LIBCXX_ENABLE_RTTI)<br>
-  pythonize_bool(LIBCXX_ENABLE_SHARED)<br>
-  pythonize_bool(LIBCXX_BUILD_32_BITS)<br>
-  pythonize_bool(LIBCXX_ENABLE_GLOBAL_FILESYSTEM_NAMESPACE)<br>
-  pythonize_bool(LIBCXX_ENABLE_STDIN)<br>
-  pythonize_bool(LIBCXX_ENABLE_STDOUT)<br>
-  pythonize_bool(LIBCXX_ENABLE_THREADS)<br>
-  pythonize_bool(LIBCXX_ENABLE_THREAD_UNSAFE_C_FUNCTIONS)<br>
-  pythonize_bool(LIBCXX_ENABLE_MONOTONIC_CLOCK)<br>
-  pythonize_bool(LIBCXX_GENERATE_COVERAGE)<br>
-  pythonize_bool(LIBCXXABI_USE_LLVM_UNWINDER)<br>
-<br>
-  # The tests shouldn't link to any ABI library when it has been linked into<br>
-  # libc++ statically.<br>
-  if (LIBCXX_ENABLE_STATIC_ABI_LIBRARY)<br>
-    set(LIBCXX_CXX_ABI_LIBNAME "none")<br>
-  endif()<br>
-  set(LIBCXX_TARGET_INFO "libcxx.test.target_info.LocalTI" CACHE STRING<br>
-      "TargetInfo to use when setting up test environment.")<br>
-  set(LIBCXX_EXECUTOR "None" CACHE STRING<br>
-      "Executor to use when running tests.")<br>
-<br>
-  set(AUTO_GEN_COMMENT "## Autogenerated by libcxx configuration.\n# Do not edit!")<br>
-<br>
-  configure_file(<br>
-    ${CMAKE_CURRENT_SOURCE_DIR}/<a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__lit.site.cfg.in&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=BSqEv9KvKMW_Ob8SyngJ70KdZISM_ASROnREeq0cCxk&m=Ub_h1-I9qWSM9gqTpFPvCi_IvgC_XNe9Sp_21eCi7d0&s=2xnVpFEr0IGVL_WFM70QsG-_B1PcAQj7UzmuOZ1ysVU&e=" rel="noreferrer" target="_blank">lit.site.cfg.in</a><br>
-    ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg<br>
-    @ONLY)<br>
-<br>
-  add_custom_target(check-libcxx<br>
-    COMMAND ${LIT_EXECUTABLE}<br>
-            ${LIT_ARGS}<br>
-            ${CMAKE_CURRENT_BINARY_DIR}<br>
-    DEPENDS cxx<br>
-    COMMENT "Running libcxx tests"<br>
-    ${cmake_3_2_USES_TERMINAL})<br>
-<br>
-  if (LIBCXX_GENERATE_COVERAGE)<br>
-    include(CodeCoverage)<br>
-    set(output_dir "${CMAKE_CURRENT_BINARY_DIR}/coverage")<br>
-    set(capture_dirs "${LIBCXX_LIB_CMAKEFILES_DIR}/cxx.dir/;${CMAKE_CURRENT_BINARY_DIR}")<br>
-    set(extract_dirs "${LIBCXX_SOURCE_DIR}/include;${LIBCXX_SOURCE_DIR}/src")<br>
-    setup_lcov_test_target_coverage("cxx" "${output_dir}" "${capture_dirs}" "${extract_dirs}")<br>
-  endif()<br>
-else()<br>
-  message(WARNING<br>
-          "LIT_EXECUTABLE not set, no check-libcxx target will be available!")<br>
+set(LIBCXX_TARGET_INFO "libcxx.test.target_info.LocalTI" CACHE STRING<br>
+    "TargetInfo to use when setting up test environment.")<br>
+set(LIBCXX_EXECUTOR "None" CACHE STRING<br>
+    "Executor to use when running tests.")<br>
+<br>
+set(AUTO_GEN_COMMENT "## Autogenerated by libcxx configuration.\n# Do not edit!")<br>
+<br>
+configure_file(<br>
+  ${CMAKE_CURRENT_SOURCE_DIR}/<a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__lit.site.cfg.in&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=BSqEv9KvKMW_Ob8SyngJ70KdZISM_ASROnREeq0cCxk&m=Ub_h1-I9qWSM9gqTpFPvCi_IvgC_XNe9Sp_21eCi7d0&s=2xnVpFEr0IGVL_WFM70QsG-_B1PcAQj7UzmuOZ1ysVU&e=" rel="noreferrer" target="_blank">lit.site.cfg.in</a><br>
+  ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg<br>
+  @ONLY)<br>
+<br>
+add_lit_testsuite(check-libcxx "Running libcxx tests"<br>
+  ${CMAKE_CURRENT_BINARY_DIR}<br>
+  DEPENDS cxx)<br>
+<br>
+if (LIBCXX_GENERATE_COVERAGE)<br>
+  include(CodeCoverage)<br>
+  set(output_dir "${CMAKE_CURRENT_BINARY_DIR}/coverage")<br>
+  set(capture_dirs "${LIBCXX_LIB_CMAKEFILES_DIR}/cxx.dir/;${CMAKE_CURRENT_BINARY_DIR}")<br>
+  set(extract_dirs "${LIBCXX_SOURCE_DIR}/include;${LIBCXX_SOURCE_DIR}/src")<br>
+  setup_lcov_test_target_coverage("cxx" "${output_dir}" "${capture_dirs}" "${extract_dirs}")<br>
 endif()<br>
<br>
Modified: libcxx/trunk/test/<a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__lit.site.cfg.in&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=BSqEv9KvKMW_Ob8SyngJ70KdZISM_ASROnREeq0cCxk&m=Ub_h1-I9qWSM9gqTpFPvCi_IvgC_XNe9Sp_21eCi7d0&s=2xnVpFEr0IGVL_WFM70QsG-_B1PcAQj7UzmuOZ1ysVU&e=" rel="noreferrer" target="_blank">lit.site.cfg.in</a><br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_libcxx_trunk_test_lit.site.cfg.in-3Frev-3D243574-26r1-3D243573-26r2-3D243574-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=BSqEv9KvKMW_Ob8SyngJ70KdZISM_ASROnREeq0cCxk&m=Ub_h1-I9qWSM9gqTpFPvCi_IvgC_XNe9Sp_21eCi7d0&s=5_aRipBgQSBSclXivQJ1x2tP6Fy37SOtfO4A3438Pzs&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/lit.site.cfg.in?rev=243574&r1=243573&r2=243574&view=diff</a><br>
==============================================================================<br>
--- libcxx/trunk/test/<a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__lit.site.cfg.in&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=BSqEv9KvKMW_Ob8SyngJ70KdZISM_ASROnREeq0cCxk&m=Ub_h1-I9qWSM9gqTpFPvCi_IvgC_XNe9Sp_21eCi7d0&s=2xnVpFEr0IGVL_WFM70QsG-_B1PcAQj7UzmuOZ1ysVU&e=" rel="noreferrer" target="_blank">lit.site.cfg.in</a> (original)<br>
+++ libcxx/trunk/test/<a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__lit.site.cfg.in&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=BSqEv9KvKMW_Ob8SyngJ70KdZISM_ASROnREeq0cCxk&m=Ub_h1-I9qWSM9gqTpFPvCi_IvgC_XNe9Sp_21eCi7d0&s=2xnVpFEr0IGVL_WFM70QsG-_B1PcAQj7UzmuOZ1ysVU&e=" rel="noreferrer" target="_blank">lit.site.cfg.in</a> Wed Jul 29 16:07:28 2015<br>
@@ -1,6 +1,5 @@<br>
 @AUTO_GEN_COMMENT@<br>
 config.cxx_under_test           = "@LIBCXX_COMPILER@"<br>
-config.std                      = "@LIBCXX_STD_VERSION@"<br>
 config.libcxx_src_root          = "@LIBCXX_SOURCE_DIR@"<br>
 config.libcxx_obj_root          = "@LIBCXX_BINARY_DIR@"<br>
 config.cxx_library_root         = "@LIBCXX_LIBRARY_DIR@"<br>
<br>
Modified: libcxx/trunk/www/index.html<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_libcxx_trunk_www_index.html-3Frev-3D243574-26r1-3D243573-26r2-3D243574-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=BSqEv9KvKMW_Ob8SyngJ70KdZISM_ASROnREeq0cCxk&m=Ub_h1-I9qWSM9gqTpFPvCi_IvgC_XNe9Sp_21eCi7d0&s=qJyyljw_64urH0DqWruQsim9TLz94arAx-NNJ3i19M0&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/libcxx/trunk/www/index.html?rev=243574&r1=243573&r2=243574&view=diff</a><br>
==============================================================================<br>
--- libcxx/trunk/www/index.html (original)<br>
+++ libcxx/trunk/www/index.html Wed Jul 29 16:07:28 2015<br>
@@ -184,26 +184,30 @@<br>
<br>
   <p>In-tree build:</p><br>
   <ul><br>
+    <li><code>cd where-you-want-to-live</code></li><br>
     <li>Check out libcxx and <a href="<a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__libcxxabi.llvm.org_&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=BSqEv9KvKMW_Ob8SyngJ70KdZISM_ASROnREeq0cCxk&m=Ub_h1-I9qWSM9gqTpFPvCi_IvgC_XNe9Sp_21eCi7d0&s=VTubTJbn4ayixlONqrDLIKT0occ8w2m9SF1QcLRbYP8&e=" rel="noreferrer" target="_blank">http://libcxxabi.llvm.org/</a>">libcxxabi</a><br>
       into llvm/projects</li><br>
-    <li><code>cd llvm</code></li><br>
+    <li><code>cd where-you-want-to-build</code></li><br>
     <li><code>mkdir build &amp;&amp; cd build</code></li><br>
-    <li><code>cmake .. # Linux may require -DCMAKE_C_COMPILER=clang<br>
+    <li><code>cmake path/to/llvm # Linux may require -DCMAKE_C_COMPILER=clang<br>
         -DCMAKE_CXX_COMPILER=clang++</code></li><br>
     <li><code>make cxx</code></li><br>
   </ul><br>
<br>
-  <p>Out-of-tree build:</p><br>
+  <p>Out-of-tree buildc:</p><br>
   <ul><br>
-    <li>Check out libcxx</li><br>
+    <li><code>cd where-you-want-to-live</code></li><br>
+    <li>Check out libcxx and llvm</li><br>
     <li>If not on a Mac, also check out<br>
       <a href="<a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__libcxxabi.llvm.org_&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=BSqEv9KvKMW_Ob8SyngJ70KdZISM_ASROnREeq0cCxk&m=Ub_h1-I9qWSM9gqTpFPvCi_IvgC_XNe9Sp_21eCi7d0&s=VTubTJbn4ayixlONqrDLIKT0occ8w2m9SF1QcLRbYP8&e=" rel="noreferrer" target="_blank">http://libcxxabi.llvm.org/</a>">libcxxabi</a></li><br>
-    <li><code>cd libcxx</code></li><br>
+    <li><code>cd where-you-want-to-build</code></li><br>
     <li><code>mkdir build &amp;&amp; cd build</code></li><br>
-    <li><code>cmake -DLIBCXX_CXX_ABI=libcxxabi<br>
+    <li><code>cmake -DLLVM_PATH=path/to/llvm<br>
+        -DLIBCXX_CXX_ABI=libcxxabi<br>
         -DLIBCXX_CXX_ABI_INCLUDE_PATHS=path/to/libcxxabi/include<br>
-        -DLIT_EXECUTABLE=path/to/llvm/utils/lit/lit.py .. # Linux may require<br>
-        -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++</code></li><br>
+        -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++<br>
+        path/to/libcxx<br>
+    </code></li><br>
     <li><code>make</code></li><br>
   </ul><br>
<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu" target="_blank">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br></div>
</blockquote></div>