-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Compiling on Windows (MSVC) results in invalid pkg-config files #1658
Comments
Hi @btgoodwin , |
I gave the this patch a whirl today. It temporarily changes the From d60ed3b81cc537a2045f70be130385d39f2b6199 Mon Sep 17 00:00:00 2001
From: Thomas Goodwin <[email protected]>
Date: Tue, 25 May 2021 15:34:16 -0400
Subject: [PATCH] cmake/utilities.cmake: change LIBRARY_DIRECTORY for DLLs
DLL platforms install shared libraries into bin, not lib,
so we need to produce .pc files that correctly point to
the installed library location (#1658).
Signed-off-by: Thomas Goodwin <[email protected]>
---
cmake/utilities.cmake | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/cmake/utilities.cmake b/cmake/utilities.cmake
index 00d8f44faa..964c3dcf02 100644
--- a/cmake/utilities.cmake
+++ b/cmake/utilities.cmake
@@ -33,7 +33,12 @@ endfunction(enable_unity_build)
macro(setup_install)
if(SIMPLE_INSTALL)
+ set(TEMP_LIBRARY_DIRECTORY "${LIBRARY_DIRECTORY}")
+ if (PLATFORM_WINDOWS AND BUILD_SHARED_LIBS)
+ set(LIBRARY_DIRECTORY "bin")
+ endif()
configure_file("${AWS_NATIVE_SDK_ROOT}/toolchains/pkg-config.pc.in" "${PROJECT_NAME}.pc" @ONLY)
+ set(LIBRARY_DIRECTORY "${TEMP_LIBRARY_DIRECTORY}")
install( TARGETS ${PROJECT_NAME}
EXPORT "${PROJECT_NAME}-targets"
--
2.30.2.windows.1
|
Greetings! Sorry to say but this is a very old issue that is probably not getting as much attention as it deservers. We encourage you to check if this is still an issue in the latest release and if you find that this is still a problem, please feel free to open a new one. |
Confirm by changing [ ] to [x] below to ensure that it's a bug:
Describe the bug
The
cmake/platform/windows.cmake:15
setsCMAKE_RUNTIME_OUTPUT_DIRECTORY
to the${CMAKE_CURRENT_BINARY_DIR}/bin
with the comment that it's to collect the runtime outputs including dlls into one directory to avoid copying them when using MSVC. Thetoolchains/pkg-config.pc.in
template configures theLibs
to point atlibdir
, which is set to@CMAKE_INSTALL_PREFIX@/@LIBRARY_DIRECTORY@
. When a downstream project attempts to usepkg-config
to locate the libraries, they're not found because the package config file says to look inlib
but the libraries are actually inbin
.SDK version number
1.9.24 (main branch, hash 9be7f32)
Platform/OS/Hardware/Device
Windows 10
To Reproduce (observed behavior)
Then checking
pkg-config
(provided by gstreamer in my case):If we check that path, we find neither of those
.lib
files:Instead, each are over in
c:\aws-cpp-sdk-all\bin
. This results in linker errors related to apparently-missing files as seen here.Expected behavior
The generated package config files should match the installation environment. In this case, either install the libraries into
lib
or generate a package config with flags pointed tobin
, where the files are actually installed.Logs/output
See above.
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: