[ 
https://issues.apache.org/jira/browse/ARROW-2238?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16389717#comment-16389717
 ] 

ASF GitHub Bot commented on ARROW-2238:
---------------------------------------

wesm closed pull request #1684: ARROW-2238: [C++] Detect and use clcache in 
cmake configuration
URL: https://github.com/apache/arrow/pull/1684
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/.gitignore b/.gitignore
index f5b235a899..c902ba39cb 100644
--- a/.gitignore
+++ b/.gitignore
@@ -26,6 +26,11 @@
 .build_cache_dir
 MANIFEST
 
+# Generated Visual Studio files
+*.vcxproj
+*.vcxproj.*
+*.sln
+
 cpp/.idea/
 python/.eggs/
 .vscode
diff --git a/ci/appveyor-setup.bat b/ci/appveyor-setup.bat
index 34f8f1d33e..d781ceb2e1 100644
--- a/ci/appveyor-setup.bat
+++ b/ci/appveyor-setup.bat
@@ -48,8 +48,6 @@ if "%USE_CLCACHE%" == "true" (
     @rem Use clcache for faster builds
     pip install -q git+https://github.com/frerich/clcache.git
     clcache -s
-    set CC=clcache
-    set CXX=clcache
     set CLCACHE_SERVER=1
     set CLCACHE_HARDLINK=1
     powershell.exe -Command "Start-Process clcache-server"
diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt
index 8c0e95634f..f24b034c18 100644
--- a/cpp/CMakeLists.txt
+++ b/cpp/CMakeLists.txt
@@ -204,6 +204,10 @@ if("${CMAKE_SOURCE_DIR}" STREQUAL 
"${CMAKE_CURRENT_SOURCE_DIR}")
     OFF)
 
   if (MSVC)
+    option(ARROW_USE_CLCACHE
+      "Use clcache if available"
+      ON)
+
     set(BROTLI_MSVC_STATIC_LIB_SUFFIX "-static" CACHE STRING
       "Brotli static lib suffix used on Windows with MSVC (default -static)")
     set(SNAPPY_MSVC_STATIC_LIB_SUFFIX "_static" CACHE STRING
@@ -259,6 +263,15 @@ else()
   set(ARROW_BOOST_HEADER_ONLY 1)
 endif()
 
+if (MSVC AND ARROW_USE_CLCACHE AND
+     (("${CMAKE_GENERATOR}" STREQUAL "NMake Makefiles") OR
+      ("${CMAKE_GENERATOR}" STREQUAL "Ninja")))
+  find_program(CLCACHE_FOUND clcache)
+  if(CLCACHE_FOUND)
+    set(CMAKE_CXX_COMPILER ${CLCACHE_FOUND})
+  endif(CLCACHE_FOUND)
+endif()
+
 ############################################################
 # Compiler flags
 ############################################################


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> [C++] Detect clcache in cmake configuration
> -------------------------------------------
>
>                 Key: ARROW-2238
>                 URL: https://issues.apache.org/jira/browse/ARROW-2238
>             Project: Apache Arrow
>          Issue Type: Improvement
>          Components: C++
>            Reporter: Antoine Pitrou
>            Assignee: Antoine Pitrou
>            Priority: Minor
>              Labels: pull-request-available
>             Fix For: 0.9.0
>
>
> By default Windows builds should use clcache if installed.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to