From 93f13871d8e86d00bcf5fbb14981071f77836905 Mon Sep 17 00:00:00 2001 From: Stefan Hacker Date: Sun, 28 Jan 2018 03:32:16 +0100 Subject: Fix helloworld zlib include directory confusion in run_distrib_test_cmake.bat We have to give cmake the explicit zlib location as the internal testing environment has C:/msys64/usr/bin in the PATH and zlib-devel installed. cmake has heuristics in find_package which sees this /bin suffix in PATH and adds C:/msys64/usr/ to the find_package search locations. Doing a find_package(zlib) in this environment makes the find module for it (FindZLIB) find the header zlib.h in C:/msys64/usr/include while the library will still be taken from the testinstall location masking the issue in the log. To satisfy the dependency cmake adds C:/msys64/usr/include as an include directory. This makes cl.exe build with mixed C and C++ standard lib headers breaking the build. This issue was previously masked by cmake writing absolute paths for zlib and other dependencies into the grpc cmake exports. --- test/distrib/cpp/run_distrib_test_cmake.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test') diff --git a/test/distrib/cpp/run_distrib_test_cmake.bat b/test/distrib/cpp/run_distrib_test_cmake.bat index f920768ae3..44661566b1 100644 --- a/test/distrib/cpp/run_distrib_test_cmake.bat +++ b/test/distrib/cpp/run_distrib_test_cmake.bat @@ -64,7 +64,7 @@ mkdir cmake cd cmake mkdir build cd build -cmake -DCMAKE_INSTALL_PREFIX=%INSTALL_DIR% -DOPENSSL_ROOT_DIR=%OPENSSL_DIR% -DOPENSSL_INCLUDE_DIR=%OPENSSL_DIR%/include ../.. || goto :error +cmake -DCMAKE_INSTALL_PREFIX=%INSTALL_DIR% -DOPENSSL_ROOT_DIR=%OPENSSL_DIR% -DOPENSSL_INCLUDE_DIR=%OPENSSL_DIR%/include -DZLIB_LIBRARY=%INSTALL_DIR%/lib/zlibstatic.lib -DZLIB_INCLUDE_DIR=%INSTALL_DIR%/include ../.. || goto :error cmake --build . --config Release || goto :error cd ../../../../.. -- cgit v1.2.3