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

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Feb 29 13:34:36 PST 2016


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: unassignedbugs 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 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160229/8f89353d/attachment.html>


More information about the llvm-bugs mailing list