FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

PARQUET-1313: [C++] Fix gtest build failure on Windows · apache/parquet-cpp@1c3a78e · GitHub

This repository was archived by the owner on May 10, 2024. It is now read-only.
/ parquet-cpp Public archive

Commit 1c3a78e

Browse files
committed
PARQUET-1313: [C++] Fix gtest build failure on Windows
Also add an option to enable clcache if found.
1 parent c9bc237 commit 1c3a78e

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

‎CMakeLists.txt‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,9 @@ if ("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}")
164164
option(PARQUET_USE_STATIC_CRT
165165
"Build Parquet with statically linked CRT"
166166
OFF)
167+
option(PARQUET_USE_CLCACHE
168+
"Use clcache if available"
169+
ON)
167170
endif()
168171

169172
option(PARQUET_VERBOSE_THIRDPARTY_BUILD
@@ -172,6 +175,15 @@ if ("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}")
172175

173176
endif()
174177

178+
if (MSVC AND PARQUET_USE_CLCACHE AND
179+
(("${CMAKE_GENERATOR}" STREQUAL "NMake Makefiles") OR
180+
("${CMAKE_GENERATOR}" STREQUAL "Ninja")))
181+
find_program(CLCACHE_FOUND clcache)
182+
if(CLCACHE_FOUND)
183+
set(CMAKE_CXX_COMPILER ${CLCACHE_FOUND})
184+
endif(CLCACHE_FOUND)
185+
endif()
186+
175187
include(BuildUtils)
176188

177189
if (PARQUET_BUILD_TESTS OR PARQUET_BUILD_EXECUTABLES OR PARQUET_BUILD_BENCHMARKS)

‎cmake_modules/ThirdpartyToolchain.cmake‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,10 @@ if(PARQUET_BUILD_TESTS AND NOT IGNORE_OPTIONAL_PACKAGES)
287287
if("$ENV{GTEST_HOME}" STREQUAL "")
288288
if(APPLE)
289289
set(GTEST_CMAKE_CXX_FLAGS "${EP_CXX_FLAGS} -DGTEST_USE_OWN_TR1_TUPLE=1 -Wno-unused-value -Wno-ignored-attributes")
290+
elseif(MSVC)
291+
# Workaround https://github.com/google/googletest/issues/1111 until
292+
# a new gtest version is released
293+
set(GTEST_CMAKE_CXX_FLAGS "${EP_CXX_FLAGS} -D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING")
290294
else()
291295
set(GTEST_CMAKE_CXX_FLAGS "${EP_CXX_FLAGS}")
292296
endif()

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL