Skip to content

Commit 6861039

Browse files
committedJul 3, 2023
added in Nirbheek's patches from aws#1839
1 parent 2fcf454 commit 6861039

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed
 

‎CMakeLists.txt

+16
Original file line numberDiff line numberDiff 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)

‎toolchains/pkg-config.pc.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ libdir=@CMAKE_INSTALL_PREFIX@/@LIBRARY_DIRECTORY@
44
Name: @PROJECT_NAME@
55
Description: @PROJECT_DESCRIPTION@
66
Version: @PROJECT_VERSION@
7-
Cflags: -I${includedir} @PKG_CONFIG_CFLAGS@
7+
Cflags: -I${includedir} @PKG_CONFIG_CFLAGS@ @PKG_CONFIG_EXPORT_CFLAGS@
88
Libs: -L${libdir} -l@PROJECT_NAME@
99
Libs.private: @ALL_DEP_LIBS_LINK_FLAGS@
1010
Requires: @PROJECT_LIBS_STRING@

0 commit comments

Comments
 (0)
Please sign in to comment.