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@7c163ea · GitHub

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

Commit 7c163ea

Browse files
authored andcommitted
PARQUET-1313: [C++] Fix gtest build failure on Windows
Also add an option to enable clcache if found. Author: Antoine Pitrou <antoine@python.org> Closes #468 from pitrou/PARQUET-1313-msvc-gtest-warnings and squashes the following commits: 7aefdcf [Antoine Pitrou] Enable a VS2017 build on AppVeyor 1c3a78e [Antoine Pitrou] PARQUET-1313: [C++] Fix gtest build failure on Windows
1 parent 1ea4be8 commit 7c163ea

4 files changed

Lines changed: 41 additions & 5 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)

‎appveyor.yml‎

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
# Operating system (build VM template)
1919
os: Visual Studio 2015
2020

21+
matrix:
22+
fast_finish: true
23+
2124
environment:
2225
matrix:
2326
- GENERATOR: NMake Makefiles
@@ -28,10 +31,12 @@ environment:
2831
PYTHON: "3.5"
2932
ARCH: "64"
3033
CONFIGURATION: "Debug"
31-
- GENERATOR: Visual Studio 14 2015 Win64
34+
- GENERATOR: Visual Studio 15 2017 Win64
3235
PYTHON: "3.5"
3336
ARCH: "64"
3437
CONFIGURATION: "Release"
38+
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
39+
BOOST_ROOT: C:\Libraries\boost_1_64_0
3540
- GENERATOR: Visual Studio 14 2015 Win64
3641
PYTHON: "3.5"
3742
ARCH: "64"
@@ -46,14 +51,18 @@ environment:
4651
PYTHON: "3.5"
4752
ARCH: "64"
4853
CONFIGURATION: "Toolchain"
54+
4955
MSVC_DEFAULT_OPTIONS: ON
5056
BOOST_ROOT: C:\Libraries\boost_1_63_0
5157
BOOST_LIBRARYDIR: C:\Libraries\boost_1_63_0\lib64-msvc-14.0
58+
USE_CLCACHE: false
5259

5360
init:
5461
- set MINICONDA=C:\Miniconda35-x64
5562
- set PATH=%MINICONDA%;%MINICONDA%/Scripts;%MINICONDA%/Library/bin;%PATH%
56-
- if "%GENERATOR%"=="NMake Makefiles" call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x64
5763

5864
build_script:
5965
- call ci\msvc-build.bat
66+
67+
# Disable test discovery
68+
test: off

‎ci/msvc-build.bat‎

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,17 @@ if NOT "%CONFIGURATION%" == "Debug" (
3232
set PARQUET_CXXFLAGS="%PARQUET_CXXFLAGS% /WX"
3333
)
3434

35+
if "%GENERATOR%"=="NMake Makefiles" set need_vcvarsall=1
36+
37+
if defined need_vcvarsall (
38+
@rem Select desired compiler version
39+
if "%APPVEYOR_BUILD_WORKER_IMAGE%" == "Visual Studio 2017" (
40+
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" amd64
41+
) else (
42+
call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64
43+
)
44+
)
45+
3546
if "%CONFIGURATION%" == "Toolchain" (
3647
conda install -y boost-cpp=1.63 thrift-cpp=0.11.0 ^
3748
brotli=0.6.0 zlib=1.2.11 snappy=1.1.6 lz4-c=1.7.5 zstd=1.2.0 ^
@@ -47,7 +58,6 @@ if "%CONFIGURATION%" == "Toolchain" (
4758
.. || exit /B
4859

4960
cmake --build . --config Release || exit /B
50-
ctest -VV || exit /B
5161
)
5262

5363
if NOT "%CONFIGURATION%" == "Toolchain" (
@@ -59,8 +69,9 @@ if NOT "%CONFIGURATION%" == "Toolchain" (
5969
.. || exit /B
6070

6171
cmake --build . --config %CONFIGURATION% || exit /B
72+
)
6273

63-
if "%CONFIGURATION%" == "Release" (
74+
if NOT "%CONFIGURATION%" == "Debug" (
75+
@rem Tests are too slow and/or hang in debug mode
6476
ctest -VV || exit /B
65-
)
6677
)

‎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