This is an automated email from the ASF dual-hosted git repository.

wesm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/master by this push:
     new fb2316c  ARROW-2238: [C++] Detect and use clcache in cmake 
configuration
fb2316c is described below

commit fb2316c6bcb82cd5b5aca21f0672b2c02ae89466
Author: Antoine Pitrou <anto...@python.org>
AuthorDate: Wed Mar 7 10:49:05 2018 -0500

    ARROW-2238: [C++] Detect and use clcache in cmake configuration
    
    Author: Antoine Pitrou <anto...@python.org>
    
    Closes #1684 from pitrou/ARROW-2238-cmake-clcache and squashes the 
following commits:
    
    8539a0ec <Antoine Pitrou> ARROW-2238:  Detect and use clcache in cmake 
configuration
---
 .gitignore            |  5 +++++
 ci/appveyor-setup.bat |  2 --
 cpp/CMakeLists.txt    | 13 +++++++++++++
 3 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/.gitignore b/.gitignore
index f5b235a..c902ba3 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 34f8f1d..d781ceb 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 47692a8..a61bcad 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
 ############################################################

-- 
To stop receiving notification emails like this one, please contact
w...@apache.org.

Reply via email to