Skip to content

Commit

Permalink
build: Fix libdir in pkgconfig files for Windows
Browse files Browse the repository at this point in the history
Windows import libraries are installed inside ARCHIVE_DIRECTORY, not
LIBRARY_DIRECTORY. So we need to use that for libdir on Windows.

Related to amzn/amazon-s3-gst-plugin#13
  • Loading branch information
nirbheek committed Jan 9, 2022
1 parent fb8cbeb commit 8a1cf0d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,15 @@ 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()

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
@@ -1,5 +1,5 @@
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@
Expand Down

0 comments on commit 8a1cf0d

Please sign in to comment.