File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -290,6 +290,22 @@ if (LEGACY_BUILD)
290290 set (ARCHIVE_DIRECTORY "${LIBRARY_DIRECTORY} " )
291291 endif ()
292292
293+ # We need to point this to the directory containing import libraries or static
294+ # libraries on Windows, and to the directory containing the so / dylib
295+ # libraries on other platforms.
296+ if (WIN32 )
297+ set (PKG_CONFIG_LIB_DIRECTORY "${ARCHIVE_DIRECTORY} " )
298+ else ()
299+ set (PKG_CONFIG_LIB_DIRECTORY "${LIBRARY_DIRECTORY} " )
300+ endif ()
301+
302+ # MSVC consumers of the shared library need to define this macro when linking
303+ # to aws-cpp-sdk-* libs, or they will get undefined reference errors. Also
304+ # doesn't hurt to define this with MinGW, so add it unconditionally on Windows.
305+ if (WIN32 AND BUILD_SHARED_LIBS )
306+ set (PKG_CONFIG_EXPORT_CFLAGS "-DUSE_IMPORT_EXPORT" )
307+ endif ()
308+
293309 if (ENABLE_ADDRESS_SANITIZER)
294310 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -g -fno-omit-frame-pointer" )
295311 if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.1)
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ libdir=@CMAKE_INSTALL_PREFIX@/@LIBRARY_DIRECTORY@
44Name: @PROJECT_NAME@
55Description: @PROJECT_DESCRIPTION@
66Version: @PROJECT_VERSION@
7- Cflags: -I${includedir} @PKG_CONFIG_CFLAGS@
7+ Cflags: -I${includedir} @PKG_CONFIG_CFLAGS@ @PKG_CONFIG_EXPORT_CFLAGS@
88Libs: -L${libdir} -l@PROJECT_NAME@
99Libs.private: @ALL_DEP_LIBS_LINK_FLAGS@
1010Requires: @PROJECT_LIBS_STRING@
You can’t perform that action at this time.
0 commit comments