Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
build: Set -DUSE_IMPORT_EXPORT in pkgconfig files on Windows
MSVC consumers of the shared library need to define this macro when
linking to aws-cpp-sdk-* libs, or they will get undefined reference
errors. Also doesn't hurt to define this with MinGW, so add it
unconditionally on Windows.

Related to amzn/amazon-s3-gst-plugin#13
  • Loading branch information
nirbheek committed Jan 9, 2022
commit e90144526d99efad6e724afa43b869a0b081fc6a
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,13 @@ else()
set(PKG_CONFIG_LIB_DIRECTORY "${LIBRARY_DIRECTORY}")
endif()

# MSVC consumers of the shared library need to define this macro when linking
# to aws-cpp-sdk-* libs, or they will get undefined reference errors. Also
# doesn't hurt to define this with MinGW, so add it unconditionally on Windows.
if(WIN32 AND BUILD_SHARED_LIBS)
set(PKG_CONFIG_EXPORT_CFLAGS "-DUSE_IMPORT_EXPORT")
endif()

if (ENABLE_ADDRESS_SANITIZER)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -g -fno-omit-frame-pointer")
if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.1)
Expand Down
2 changes: 1 addition & 1 deletion toolchains/pkg-config.pc.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ libdir=@CMAKE_INSTALL_PREFIX@/@PKG_CONFIG_LIB_DIRECTORY@
Name: @PROJECT_NAME@
Description: @PROJECT_DESCRIPTION@
Version: @PROJECT_VERSION@
Cflags: -I${includedir} @PKG_CONFIG_CFLAGS@
Cflags: -I${includedir} @PKG_CONFIG_CFLAGS@ @PKG_CONFIG_EXPORT_CFLAGS@
Libs: -L${libdir} -l@PROJECT_NAME@
Libs.private: @ALL_DEP_LIBS_LINK_FLAGS@
Requires: @PROJECT_LIBS_STRING@