-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
[pulsar-client-cpp] Fix build failure when CMAKE_BUILD_TYPE is not specified #36147
[pulsar-client-cpp] Fix build failure when CMAKE_BUILD_TYPE is not specified #36147
Conversation
I verified the patch with the following triplets in GitHub actions, see BewareMyPower#2.
And the |
For Unix Makefiles, when I ran
So I think the debug version of |
Just found if( ${basename}_LIBRARY_DEBUG AND ${basename}_LIBRARY_RELEASE AND
NOT ${basename}_LIBRARY_DEBUG STREQUAL ${basename}_LIBRARY_RELEASE AND
( _isMultiConfig OR CMAKE_BUILD_TYPE ) )
# ...
elseif( ${basename}_LIBRARY_RELEASE )
set( ${basename}_LIBRARY ${${basename}_LIBRARY_RELEASE} )
elseif( ${basename}_LIBRARY_DEBUG )
set( ${basename}_LIBRARY ${${basename}_LIBRARY_DEBUG} )
else()
set( ${basename}_LIBRARY "${basename}_LIBRARY-NOTFOUND")
endif() Also, after learning |
@Neumann-A I updated the PR description and the cmake code, PTAL again. Now with Makefile as the generator, all debug libraries will be linked when
|
Tested usage successfully by
|
…ecified (microsoft#36147) * [pulsar-client-cpp] Fix build failure when CMAKE_BUILD_TYPE is not specified * Force finding debug libraries by default
…ecified (microsoft#36147) * [pulsar-client-cpp] Fix build failure when CMAKE_BUILD_TYPE is not specified * Force finding debug libraries by default
./vcpkg x-add-version --all
and committing the result.This patch mainly fixes the error that when
CMAKE_BUILD_TYPE
is not specified with a single-configuration generator, the build will fail because the imported location cannot be found.For example, in
<cmake-build-dir>/CMakeFiles/<target.dir>/build.cmake
, there could be a line like:This patch fixes the error above by making
unofficial::pulsar::pulsar
links debug libraries by default.In addition, fix the error that Snappy cannot be found on Linux and the logic to find libraries of the pulsar library.