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: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]
    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.
_______________________________________________
llvm-bugs mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to