Skip to content

Commit

Permalink
ARROW-7940: [C++] Remove ARROW_USE_CLCACHE handling
Browse files Browse the repository at this point in the history
The recommended way to enable `clcache` is to pass the `CMAKE_CXX_COMPILER` option to CMake, or to set the `CXX` environment variable.

Closes #6508 from vvvy/ARROW-7940 and squashes the following commits:

ab96699 <Antoine Pitrou> Remove obsolete ARROW_USE_CLCACHE option
66c308c <Valery Vybornov> ARROW-7940:  Unable to generate cmake build with settings other than default

Lead-authored-by: Antoine Pitrou <antoine@python.org>
Co-authored-by: Valery Vybornov <vvybornov@gmail.com>
Signed-off-by: Antoine Pitrou <antoine@python.org>
  • Loading branch information
pitrou and vvvy committed Mar 2, 2020
1 parent 1f0bb15 commit 479ceae
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 13 deletions.
10 changes: 0 additions & 10 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -361,16 +361,6 @@ if(ARROW_TEST_MEMCHECK)
add_definitions(-DARROW_VALGRIND)
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
#
Expand Down
2 changes: 0 additions & 2 deletions cpp/cmake_modules/DefineOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -286,8 +286,6 @@ if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}")
"Pass verbose linking options when linking libraries and executables"
OFF)

define_option(ARROW_USE_CLCACHE "Use clcache if available" ON)

define_option_string(BROTLI_MSVC_STATIC_LIB_SUFFIX
"Brotli static lib suffix used on Windows with MSVC" "-static")

Expand Down
19 changes: 18 additions & 1 deletion docs/source/developers/cpp/windows.rst
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,27 @@ do an out of source build by generating Ninja files:
cd cpp
mkdir build
cd build
cmake -G "Ninja" -DARROW_BUILD_TESTS=ON ^
cmake -G "Ninja" ^
-DCMAKE_C_COMPILER=clcache ^
-DCMAKE_CXX_COMPILER=clcache ^
-DARROW_BUILD_TESTS=ON ^
-DGTest_SOURCE=BUNDLED ..
cmake --build . --config Release
Setting ``CMAKE_C_COMPILER`` and ``CMAKE_CXX_COMPILER`` in the command line
of ``cmake`` is the preferred method of using ``clcache``. Alternatively, you
can set ``CC`` and ``CXX`` environment variables before calling ``cmake``:

.. code-block:: shell
...
set CC=clcache
set CXX=clcache
cmake -G "Ninja" ^
...
Building with NMake
===================

Expand Down

0 comments on commit 479ceae

Please sign in to comment.