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

            Bug ID: 26778
           Summary: check-libcxxabi fails when built with CXX="ccache
                    clang++"
           Product: libc++abi
           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 libcxxabi by setting CXX="ccache clang++",
check-libcxxabi will fail since LIBCXXABI_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 d77f784..381b1c4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -177,7 +177,14 @@ set(CMAKE_MODULE_PATH
 # Configure compiler.
 include(config-ix)

-set(LIBCXXABI_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} LIBCXXABI_COMPILER )
+else()
+  set(LIBCXXABI_COMPILER ${CMAKE_CXX_COMPILER})
+endif()
 set(LIBCXXABI_SOURCE_DIR  ${CMAKE_CURRENT_SOURCE_DIR})
 set(LIBCXXABI_BINARY_DIR  ${CMAKE_CURRENT_BINARY_DIR})
 set(LIBCXXABI_LIBRARY_DIR ${CMAKE_BINARY_DIR}/lib${LIBCXXABI_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