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

[libmodplug] Fix WASM build by pinning C++ standard to 11 #37090

Merged
merged 1 commit into from
Mar 5, 2024

Conversation

fwcd
Copy link
Contributor

@fwcd fwcd commented Mar 2, 2024

Fixes #37089

The port uses the register storage class specifier which was removed in C++17, pinning the standard to C++11 solves this.

  • Changes comply with the maintainer guide.
  • SHA512s are updated for each updated download.
  • The "supports" clause reflects platforms that may be fixed by this new version.
  • Any fixed CI baseline entries are removed from that file.
  • Any patches that are no longer applied are deleted from the port's directory.
  • The version database is fixed by rerunning ./vcpkg x-add-version --all and committing the result.
  • Only one version is added to each modified port's versions file.

Comment on lines 23 to 29
-DCMAKE_CXX_STANDARD=11
)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
-DCMAKE_CXX_STANDARD=11
)
-DCMAKE_CXX_STANDARD=${CXX_STANDARD}
)
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "wasm32")
set(CXX_STANDARD 11)
endif()

Regarding specifying the c++ version, especially the lower standard approach, I think we should filter it。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If we do this, I would probably go with VCPKG_TARGET_IS_EMSCRIPTEN, since this is specific to the compiler. Off top of my head, we'd probably also have to move it above the configure.

I'm actually a bit surprised that it builds on all other major platforms as-is though, especially given that Emscripten just runs Clang under the hood. Maybe the major compilers are more lenient when it comes to accepting older C++ standards by default?

Copy link
Contributor

Choose a reason for hiding this comment

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

Upstream has no special instructions for the C++ standard, so a lower standard may be accepted. :)

Copy link
Contributor

Choose a reason for hiding this comment

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

It's better to use VCPKG_TARGET_IS_EMSCRIPTEN.

@FrankXie05
Copy link
Contributor

Note: I will be converting your PR to draft status. When you respond, please revert to "ready for review".
That way, I can be aware that you've responded since you can't modify the tags.

@FrankXie05 FrankXie05 marked this pull request as draft March 4, 2024 06:33
@FrankXie05 FrankXie05 added category:port-bug The issue is with a library, which is something the port should already support category:community-triplet A PR or issue related to community triplets not officially validated by the vcpkg team. labels Mar 4, 2024
@fwcd fwcd marked this pull request as ready for review March 4, 2024 23:08
@FrankXie05 FrankXie05 added the info:reviewed Pull Request changes follow basic guidelines label Mar 5, 2024
@vicroms vicroms merged commit 8454a8d into microsoft:master Mar 5, 2024
16 checks passed
@fwcd fwcd deleted the libmodplug-cxx-11 branch March 5, 2024 15:00
fwcd added a commit to fwcd/vcpkg that referenced this pull request Mar 5, 2024
…37090)

Fixes microsoft#37089 

The port uses the register storage class specifier which was removed in
C++17, pinning the standard to C++11 solves this.

- [x] Changes comply with the [maintainer
guide](https://github.com/microsoft/vcpkg-docs/blob/main/vcpkg/contributing/maintainer-guide.md).
- [x] SHA512s are updated for each updated download.
- [x] The "supports" clause reflects platforms that may be fixed by this
new version.
- [x] Any fixed [CI
baseline](https://github.com/microsoft/vcpkg/blob/master/scripts/ci.baseline.txt)
entries are removed from that file.
- [x] Any patches that are no longer applied are deleted from the port's
directory.
- [x] The version database is fixed by rerunning `./vcpkg x-add-version
--all` and committing the result.
- [x] Only one version is added to each modified port's versions file.
daschuer added a commit to mixxxdj/vcpkg that referenced this pull request Mar 5, 2024
[libmodplug] Fix WASM build by pinning C++ standard to 11 (microsoft#37090)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:community-triplet A PR or issue related to community triplets not officially validated by the vcpkg team. category:port-bug The issue is with a library, which is something the port should already support info:reviewed Pull Request changes follow basic guidelines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[libmodplug] Build error on wasm32-emscripten
3 participants