[llvm-bugs] [Bug 26777] New: check-libcxx fails when built with CXX="ccache clang++"

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Feb 29 13:32:31 PST 2016


https://llvm.org/bugs/show_bug.cgi?id=26777

            Bug ID: 26777
           Summary: check-libcxx fails when built with CXX="ccache
                    clang++"
           Product: libc++
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: hintonda at gmail.com
                CC: llvm-bugs at lists.llvm.org, mclow.lists at gmail.com
    Classification: Unclassified

If you use ccache to build libcxx by setting CXX="ccache clang++", check-libcxx
will fail since LIBCXX_COMPILER will be set to "ccache".

We can't just include CMAKE_CXX_COMPILER_ARG1 because of a python parsing
issue, so the best we can do right now is to use CMAKE_CXX_COMPILER_ARG1 if it
exists, and CMAKE_CXX_COMPILER if it doesn't.

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9387f7c..c89cccd 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -219,7 +219,14 @@ endif()
 # Configure System

#===============================================================================

-set(LIBCXX_COMPILER    ${CMAKE_CXX_COMPILER})
+# When ccache is used, the actual compiler will be in arg1.  Solves
+# a python parsing issue in CXXCompiler() where parameters with spaces are
+# treated as seperate parameters.
+if(CMAKE_CXX_COMPILER_ARG1)
+  string(STRIP ${CMAKE_CXX_COMPILER_ARG1} LIBCXX_COMPILER )
+else()
+  set(LIBCXX_COMPILER ${CMAKE_CXX_COMPILER})
+endif()
 set(LIBCXX_SOURCE_DIR  ${CMAKE_CURRENT_SOURCE_DIR})
 set(LIBCXX_BINARY_DIR  ${CMAKE_CURRENT_BINARY_DIR})
 set(LIBCXX_LIBRARY_DIR ${CMAKE_BINARY_DIR}/lib${LIBCXX_LIBDIR_SUFFIX})

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160229/1b8d8d60/attachment.html>


More information about the llvm-bugs mailing list