Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix pkgconfig files on windows #1839

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
16 changes: 16 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,22 @@ else()
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
4 changes: 2 additions & 2 deletions toolchains/pkg-config.pc.in
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
includedir=@CMAKE_INSTALL_PREFIX@/@INCLUDE_DIRECTORY@
libdir=@CMAKE_INSTALL_PREFIX@/@LIBRARY_DIRECTORY@
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@