Skip to content

Commit 5d405c5

Browse files
committed
Fix failure to link static Curl to shared producer due to no being position-independent
1 parent 8ada539 commit 5d405c5

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

CMake/Dependencies/libkvscproducer-CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@ include(ExternalProject)
77
# clone repo only
88
ExternalProject_Add(libkvscproducer-download
99
GIT_REPOSITORY https://github.com/awslabs/amazon-kinesis-video-streams-producer-c.git
10-
GIT_TAG v1.5.3
10+
GIT_TAG static-curl-to-shared-producer
1111
SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/kvscproducer-src"
1212
BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/kvscproducer-build"
13+
CMAKE_ARGS
14+
-DCURL_POSITION_INDEPENDENT_CODE=${CURL_POSITION_INDEPENDENT_CODE}
1315
CONFIGURE_COMMAND ""
1416
BUILD_COMMAND ""
1517
INSTALL_COMMAND ""

CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ endif()
5757
add_definitions(-DKVS_CA_CERT_PATH="${CMAKE_CURRENT_SOURCE_DIR}/certs/cert.pem")
5858
add_definitions(-DCMAKE_DETECTED_CACERT_PATH)
5959

60+
# Instruct Producer C to build Curl with Position Independent Code (-fpic).
61+
# This is to allow a static Curl build to link with to a shared Producer Cpp build.
62+
if(BUILD_STATIC AND BUILD_FORCE_GSTREAMER_PLUGIN_SHARED)
63+
set(CURL_POSITION_INDEPENDENT_CODE TRUE)
64+
endif()
6065

6166
if(BUILD_DEPENDENCIES)
6267
if(NOT EXISTS ${KINESIS_VIDEO_OPEN_SOURCE_SRC})

0 commit comments

Comments
 (0)