Skip to content

Commit

Permalink
added in Nirbheek's patches from aws#1839
Browse files Browse the repository at this point in the history
  • Loading branch information
saraboule committed Jul 3, 2023
1 parent 2fcf454 commit 6861039
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
16 changes: 16 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,22 @@ if (LEGACY_BUILD)
set(ARCHIVE_DIRECTORY "${LIBRARY_DIRECTORY}")
endif ()

# We need to point this to the directory containing import libraries or static
# libraries on Windows, and to the directory containing the so / dylib
# libraries on other platforms.
if(WIN32)
set(PKG_CONFIG_LIB_DIRECTORY "${ARCHIVE_DIRECTORY}")
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@/@LIBRARY_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@

0 comments on commit 6861039

Please sign in to comment.