Repository navigation
fix(cmake): 修复 sapi-static 单独构建时 mpdecimal 缺少 C++ 标准导致的 macOS 编译失败 - #127
Merged
Merged
Conversation
Member
|
感谢提交修复,也感谢详细的问题分析和构建验证!PR 已合并。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
sapi-static/CMakeLists.txt 在 php-builder 私有运行时流程中被单独作为顶层 CMake 工程使用,因此读不到根 CMakeLists 里的 CMAKE_CXX_STANDARD 17。mpdecimal_obj 目标唯一的 C++ 源文件 decimal.cc 就按编译器默认标准编译——Apple Clang 默认 gnu++98,decimal.hh 的 constexpr 全部编译失败(Linux GCC 11+ 默认 gnu++17,所以 CI 从未暴露)。
为其显式补上 CXX_STANDARD 17 + CXX_STANDARD_REQUIRED ON,与其既有的 C_STANDARD 99 并列。修复后 macOS(Apple Clang)构建通过,Linux 语义零变化。