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

[wxWidgets] static triplet only debug/release library mixup #16545

Closed
brad-anderson opened this issue Mar 5, 2021 · 9 comments · Fixed by #16546 or #24047
Closed

[wxWidgets] static triplet only debug/release library mixup #16545

brad-anderson opened this issue Mar 5, 2021 · 9 comments · Fixed by #16546 or #24047
Assignees
Labels
category:port-bug The issue is with a library, which is something the port should already support

Comments

@brad-anderson
Copy link
Contributor

Describe the bug
When using wxWidgets supplied by vcpkg through CMake in a statically linked debug configuration project, the linker gets supplied with the release versions of the wxwidgets libraries instead of the debug versions.

Environment

  • OS: Windows
  • Compiler: cl.exe 19.28.29910

To Reproduce
Steps to reproduce the behavior:

  1. ./vcpkg install wxwidgets:x64-windows-static
  2. Use wxWidgets in a statically linked debug project
  3. See error

I've attached a basic CMakeLists.txt and the wxWidget's reference hello world to reproduce. I'm using VS 2019 CMake support and specifying my CMake toolchain and vcpkg triplet in my CMakeSettings.json.

Expected behavior
Debug libraries should be provided. This works correctly on x64-windows.

Failure logs
wxwidgets-static-debrel-mixup.txt

Additional context
Getting to this point relies on a PR I made to fix an earlier issue with linking libpng: #16544

@JackBoosY JackBoosY added the category:port-bug The issue is with a library, which is something the port should already support label Mar 5, 2021
@JackBoosY
Copy link
Contributor

Confirmed.

@JackBoosY
Copy link
Contributor

Seems like FindwxWidgets.cmake doesn't find the debug libraries correctly.

@brad-anderson
Copy link
Contributor Author

Some context, FindwxWidgets.cmake had never worked with vcpkg and only recently was made to work (see #4756). That change made it finally work but for reasons I haven't quite teased out it fails for the static triplets.

I'd love to get some proper CMake targets for wxWidgets but FindwxWidgets.cmake is >1k lines so I think most people, like myself, haven't found the time/courage to tackle it.

@JackBoosY
Copy link
Contributor

Will be fixed in #16546.

@JackBoosY JackBoosY linked a pull request Mar 5, 2021 that will close this issue
@brad-anderson
Copy link
Contributor Author

I don't believe this is fixed. Unfortunately I'm dealing with the cairo port getting all messed up recently so I haven't been able to give HEAD a proper test yet but there is nothing in the commit for #16546 that would have addressed this issue.

@JackBoosY
Copy link
Contributor

@brad-anderson Please ping me if this issue is still exist.

@brad-anderson
Copy link
Contributor Author

@JackBoosY I've confirmed this is still an issue.

@JackBoosY JackBoosY reopened this Jul 13, 2021
@JackBoosY
Copy link
Contributor

Will be fixed by #17111.

@JackBoosY JackBoosY linked a pull request Jul 13, 2021 that will close this issue
@jdoubleu
Copy link

jdoubleu commented Nov 25, 2021

Unfortunately, #17111 hasn't been merged yet, so the issue still exists.

Trying to understand Finxwswidgets.cmake, it looks like it does not honor the debug/lib directory at all but rather expects the debug library path to be at wsmud/lib ($WX_ROOT_DIR might be ${WX_BASE_DIR}/${wxWidgets_CONFIGURATION}).

I think the main issue is with the folder structure of the wxWidgets VCPKG package not being compatible with CMake's expected structure, which might also be the structure from wxWidgets' distributed binaries.

Just noticed, that this isn't just an issue with the static libraries. For the dynamic ones, CMake still picks the release version. You should be able to observe this at configuration time, when CMake logs:

Found wxWidgets: C:/my_project/cmake-build-release/vcpkg_installed/x64-windows/lib/wxmsw31u_core.lib;

It's just that you'll notice sooner with the static variants, because the Linker will error out. With the dynamic libs I got unexpected crashes due to error code 0xC0000005 (Access violation).

@JackBoosY JackBoosY linked a pull request Apr 14, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:port-bug The issue is with a library, which is something the port should already support
Projects
None yet
3 participants