Skip to content

Commit 8a1cf0d

Browse files
committed
build: Fix libdir in pkgconfig files for Windows
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
1 parent fb8cbeb commit 8a1cf0d

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,15 @@ else()
257257
set(ARCHIVE_DIRECTORY "${LIBRARY_DIRECTORY}")
258258
endif()
259259

260+
# We need to point this to the directory containing import libraries or static
261+
# libraries on Windows, and to the directory containing the so / dylib
262+
# libraries on other platforms.
263+
if(WIN32)
264+
set(PKG_CONFIG_LIB_DIRECTORY "${ARCHIVE_DIRECTORY}")
265+
else()
266+
set(PKG_CONFIG_LIB_DIRECTORY "${LIBRARY_DIRECTORY}")
267+
endif()
268+
260269
if (ENABLE_ADDRESS_SANITIZER)
261270
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -g -fno-omit-frame-pointer")
262271
if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.1)

toolchains/pkg-config.pc.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
includedir=@CMAKE_INSTALL_PREFIX@/@INCLUDE_DIRECTORY@
2-
libdir=@CMAKE_INSTALL_PREFIX@/@LIBRARY_DIRECTORY@
2+
libdir=@CMAKE_INSTALL_PREFIX@/@PKG_CONFIG_LIB_DIRECTORY@
33

44
Name: @PROJECT_NAME@
55
Description: @PROJECT_DESCRIPTION@

0 commit comments

Comments
 (0)