hintonda created this revision.
hintonda added a reviewer: mclow.lists.
hintonda added a subscriber: cfe-commits.

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.

http://reviews.llvm.org/D17734

Files:
  CMakeLists.txt

Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -219,7 +219,14 @@
 # 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})


Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -219,7 +219,14 @@
 # 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})
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to