Skip to content

[spdlog] support wchar when target is Windows#18041

Merged
BillyONeal merged 14 commits intomicrosoft:masterfrom
luncliff:port/spdlog
Jul 15, 2021
Merged

[spdlog] support wchar when target is Windows#18041
BillyONeal merged 14 commits intomicrosoft:masterfrom
luncliff:port/spdlog

Conversation

@luncliff
Copy link
Copy Markdown
Contributor

@luncliff luncliff commented May 21, 2021

What does your PR fix?

Possible fix of #16926? I think the error message can be incorrect because spdlog uses macro guards to show/hide overloaded functions.

SPDLOG_WCHAR_SUPPORT

Adds 2 functions into DLL (spdlog::spdlog IMPORTED target)

  • wstr_to_utf8buf
  • utf8_to_wstrbuf

Became a port feature. It can be activated with spdlog[wchar].

The library double checks this macro with _WIN32, so the other platforms won't need this.

SPDLOG_WCHAR_FILENAMES

See comments below!

This option makes interfaces to use std::wstring instead of std::string.
ON for this option will break windows users' builds.

Became a port feature. It can be activated with spdlog[wchar-filenames].

Which triplets are supported/not supported? Have you updated the CI baseline?

Windows(windows, uwp) triplets will be affected.

Does your PR follow the maintainer guide?

Checked.

luncliff added 2 commits May 21, 2021 14:20
* filename will be `std::string`
* functions `wstr_to_utf8buf`, `utf8_to_wstrbuf` will be added
@luncliff luncliff changed the title [spdlog] support wchar when target is Windows paltform [spdlog] support wchar when target is Windows May 21, 2021
@JonLiu1993 JonLiu1993 self-assigned this May 21, 2021
@JackBoosY JackBoosY added the category:port-bug The issue is with a library, which is something the port should already support label May 21, 2021
Comment thread ports/spdlog/portfile.cmake Outdated
* new feature: `wchar`, `wchar-filenames`
* update git-tree SHA
@JackBoosY JackBoosY added info:needs-maintainer-attention Lets the current 'on rotation' vcpkg maintainer know they need to look at this. and removed requires:author-response labels May 24, 2021
Copy link
Copy Markdown
Contributor

@strega-nil-ms strega-nil-ms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wchar is a great feature. However, wchar-filenames is not a feature. Features must be additive, and must not change existing APIs.

The correct way forward is via a triplet option. I can't find a good example, but basically, you'd set it up so that in a triplet you can write:

if (PORT STREQUAL "spdlog")
  set(SPDLOG_WCHAR_FILENAMES ON)
endif()

You can see how you might do this via the suggestions

Comment thread ports/spdlog/portfile.cmake Outdated
Comment thread ports/spdlog/portfile.cmake Outdated
@strega-nil-ms strega-nil-ms added requires:author-response and removed info:needs-maintainer-attention Lets the current 'on rotation' vcpkg maintainer know they need to look at this. labels Jun 2, 2021
luncliff and others added 3 commits June 5, 2021 01:11
Co-authored-by: nicole mazzuca <83086508+strega-nil-ms@users.noreply.github.com>
Co-authored-by: nicole mazzuca <83086508+strega-nil-ms@users.noreply.github.com>
Comment thread versions/s-/spdlog.json Outdated
@JackBoosY JackBoosY requested a review from strega-nil-ms June 7, 2021 07:13
@JackBoosY
Copy link
Copy Markdown
Contributor

@strega-nil-ms Ping for review again.

@Milerius
Copy link
Copy Markdown
Contributor

Possible to have a bump on this one ?

@JonLiu1993
Copy link
Copy Markdown
Contributor

@strega-nil-ms Please help review this pr.

@JackBoosY JackBoosY added category:port-feature The issue is with a library, which is requesting new capabilities that didn’t exist requires:vcpkg-team-review This PR or issue requires someone on the vcpkg team to take a further look. and removed category:port-bug The issue is with a library, which is something the port should already support labels Jun 21, 2021
Comment thread ports/spdlog/portfile.cmake
Copy link
Copy Markdown
Contributor

@ras0219-msft ras0219-msft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR and sorry for the delay! Just a few tiny tweaks needed before merging :)

Comment thread ports/spdlog/vcpkg.json Outdated
Comment thread ports/spdlog/portfile.cmake Outdated
Comment thread ports/spdlog/portfile.cmake Outdated
Comment thread ports/spdlog/portfile.cmake
@JonLiu1993 JonLiu1993 added requires:author-response and removed requires:vcpkg-team-review This PR or issue requires someone on the vcpkg team to take a further look. labels Jul 1, 2021
luncliff and others added 4 commits July 1, 2021 10:53
Co-authored-by: Robert Schumacher <roschuma@microsoft.com>
Co-authored-by: Robert Schumacher <roschuma@microsoft.com>
Co-authored-by: Robert Schumacher <roschuma@microsoft.com>
@PhoebeHui PhoebeHui added info:needs-maintainer-attention Lets the current 'on rotation' vcpkg maintainer know they need to look at this. and removed requires:author-response labels Jul 1, 2021
@BillyONeal
Copy link
Copy Markdown
Member

Thanks for your contribution and sorry for the delay!

@BillyONeal BillyONeal merged commit ab8067a into microsoft:master Jul 15, 2021
@luncliff luncliff deleted the port/spdlog branch July 17, 2021 00:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category:port-feature The issue is with a library, which is requesting new capabilities that didn’t exist info:needs-maintainer-attention Lets the current 'on rotation' vcpkg maintainer know they need to look at this.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants