From 3142f1e947aff1dd45f05a1cab4bf2e8082c7c96 Mon Sep 17 00:00:00 2001 From: Jonas Hahnfeld Date: Mon, 25 Jul 2016 08:04:26 +0000 Subject: [PATCH] Update description for CLANG_DEFAULT_CXX_STDLIB and add comment. NFC We agreed to call it "platform default" instead of "architecture default". (see D17286) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@276618 91177308-0d34-0410-b5e6-96231b3b80d8 --- CMakeLists.txt | 4 ++-- lib/Driver/ToolChain.cpp | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cfcd2212cf..417b2c6af7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -193,11 +193,11 @@ set(ENABLE_X86_RELAX_RELOCATIONS OFF CACHE BOOL "enable x86 relax relocations by default") set(CLANG_DEFAULT_CXX_STDLIB "" CACHE STRING - "Default C++ stdlib to use (empty for architecture default, \"libstdc++\" or \"libc++\"") + "Default C++ stdlib to use (empty for platform default, \"libstdc++\" or \"libc++\"") if (NOT(CLANG_DEFAULT_CXX_STDLIB STREQUAL "" OR CLANG_DEFAULT_CXX_STDLIB STREQUAL "libstdc++" OR CLANG_DEFAULT_CXX_STDLIB STREQUAL "libc++")) - message(WARNING "Resetting default C++ stdlib to use architecture default") + message(WARNING "Resetting default C++ stdlib to use platform default") set(CLANG_DEFAULT_CXX_STDLIB "") endif() diff --git a/lib/Driver/ToolChain.cpp b/lib/Driver/ToolChain.cpp index b4491d6a55..66b76cda14 100644 --- a/lib/Driver/ToolChain.cpp +++ b/lib/Driver/ToolChain.cpp @@ -577,6 +577,8 @@ ToolChain::CXXStdlibType ToolChain::GetCXXStdlibType(const ArgList &Args) const{ << A->getAsString(Args); } + // If no argument was provided or its value was invalid, look for the + // default unless forced or configured to take the platform default. if (!HasValidType && (ForcePlatformDefault || !ParseCXXStdlibType(CLANG_DEFAULT_CXX_STDLIB, Type))) Type = GetDefaultCXXStdlibType(); -- 2.40.0