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

[portaudio] Fix library cannot be found #8944

Merged

Conversation

NancyLi1013
Copy link
Contributor

@NancyLi1013 NancyLi1013 commented Nov 8, 2019

Since the generated library name such as portaudio_x64.lib is renamed as portaudio.lib in portfile.cmake file. While in portaudioTargets.cmake, it keeps the original name portaudio_x64.lib .
So when using this port, it cannot be found by CMake.
I fix this issue by setting PA_LIBNAME_ADD_SUFFIX as OFF` and remove these codes in CMakeLists file:

IF(MSVC AND PA_BUILD_STATIC AND PA_BUILD_SHARED AND NOT PA_LIBNAME_ADD_SUFFIX)
  MESSAGE(WARNING "Building both shared and static libraries, and avoiding the suffix _static will lead to a name conflict")
  SET(PA_LIBNAME_ADD_SUFFIX ON CACHE BOOL "Forcing use of suffix _static to avoid name conflict between static and import library" FORCE)
  MESSAGE(WARNING "PA_LIBNAME_ADD_SUFFIX was set to ON")
ENDIF()

At the same time, remove the related operations that rename library name.

Related issue #8834, #8869.
Note: No features need to test.

@NancyLi1013 NancyLi1013 added the info:internal This PR or Issue was filed by the vcpkg team. label Nov 8, 2019
@NancyLi1013 NancyLi1013 requested a review from JackBoosY November 8, 2019 01:28
@traversaro
Copy link
Contributor

cc @GiulioRomualdi

@GiulioRomualdi
Copy link
Contributor

Dear @NancyLi1013 thanks for fixing the problem. Now portaudio is found by the cmake project. However as I wrote in #8834 (comment), the compilation phase failed when #include<portaudio.h> is added to the project.

@NancyLi1013
Copy link
Contributor Author

/azp run

@NancyLi1013 NancyLi1013 marked this pull request as ready for review November 20, 2019 05:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
info:internal This PR or Issue was filed by the vcpkg team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants