Skip to content

Commit 5e1344b

Browse files
kszucspitrou
authored andcommitted
ARROW-10037: [C++] Workaround to force find AWS SDK to look for shared libraries
Since the recent conda forge feedstock update find aws sdk fails to locate the proper aws sdk cmake files: https://github.com/apache/arrow/runs/1131824712#step:8:3700 Closes apache#8218 from kszucs/aws-sdk Authored-by: Krisztián Szűcs <szucs.krisztian@gmail.com> Signed-off-by: Antoine Pitrou <antoine@python.org>
1 parent bc987cd commit 5e1344b

3 files changed

Lines changed: 21 additions & 2 deletions

File tree

ci/appveyor-cpp-build.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ pushd cpp\build
8989
@rem and enable runtime assertions.
9090

9191
cmake -G "%GENERATOR%" %CMAKE_ARGS% ^
92-
-DARROW_BOOST_USE_SHARED=OFF ^
92+
-DARROW_BOOST_USE_SHARED=ON ^
9393
-DARROW_BUILD_EXAMPLES=ON ^
9494
-DARROW_BUILD_STATIC=OFF ^
9595
-DARROW_BUILD_TESTS=ON ^

ci/appveyor-cpp-setup.bat

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ if "%JOB%" NEQ "Build_Debug" (
6262
--file=ci\conda_env_python.yml ^
6363
%CONDA_PACKAGES% ^
6464
"cmake=3.17" ^
65-
"boost-cpp<1.70" ^
6665
"ninja" ^
6766
"nomkl" ^
6867
"pandas" ^

cpp/cmake_modules/ThirdpartyToolchain.cmake

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2675,6 +2675,17 @@ endmacro()
26752675
if(ARROW_S3)
26762676
# See https://aws.amazon.com/blogs/developer/developer-experience-of-the-aws-sdk-for-c-now-simplified-by-cmake/
26772677

2678+
# Workaround to force AWS cmake configuration to look for shared libraries
2679+
if(DEFINED ENV{CONDA_PREFIX})
2680+
if(DEFINED BUILD_SHARED_LIBS)
2681+
set(BUILD_SHARED_LIBS_WAS_SET TRUE)
2682+
set(BUILD_SHARED_LIBS_VALUE ${BUILD_SHARED_LIBS})
2683+
else()
2684+
set(BUILD_SHARED_LIBS_WAS_SET FALSE)
2685+
endif()
2686+
set(BUILD_SHARED_LIBS "ON")
2687+
endif()
2688+
26782689
# Need to customize the find_package() call, so cannot call resolve_dependency()
26792690
if(AWSSDK_SOURCE STREQUAL "AUTO")
26802691
find_package(AWSSDK
@@ -2697,6 +2708,15 @@ if(ARROW_S3)
26972708
sts)
26982709
endif()
26992710

2711+
# Restore previous value of BUILD_SHARED_LIBS
2712+
if(DEFINED ENV{CONDA_PREFIX})
2713+
if(BUILD_SHARED_LIBS_WAS_SET)
2714+
set(BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS_VALUE})
2715+
else()
2716+
unset(BUILD_SHARED_LIBS)
2717+
endif()
2718+
endif()
2719+
27002720
include_directories(SYSTEM ${AWSSDK_INCLUDE_DIR})
27012721
message(STATUS "Found AWS SDK headers: ${AWSSDK_INCLUDE_DIR}")
27022722
message(STATUS "Found AWS SDK libraries: ${AWSSDK_LINK_LIBRARIES}")

0 commit comments

Comments
 (0)