Fix Apple platform detection and iOS cross-build#5791
Merged
martin-frbg merged 3 commits intoOpenMathLib:developfrom May 2, 2026
Merged
Fix Apple platform detection and iOS cross-build#5791martin-frbg merged 3 commits intoOpenMathLib:developfrom
martin-frbg merged 3 commits intoOpenMathLib:developfrom
Conversation
Contributor
Author
|
I previously fixed the iOS shell script, but didn’t update Perl, CI, or the documentation. I’ve polished those up this time. |
Collaborator
|
Thank you very much |
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.
This PR fixes Apple platform detection and iOS cross-build instructions.
The main issue is that Apple clang defines
TARGET_OS_IPHONEon macOS as well,but with value
0. The previous detection only checked whether the macro wasdefined, so macOS builds could be identified as iOS. This PR checks the macro
value, adds a separate display name for Darwin targets, and updates the iOS CI
and documentation build commands so that iPhoneOS compiler flags are actually
passed to
make.Changes
ctest.cdefined(TARGET_OS_IPHONE)todefined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE.TARGET_OS_IPHONEas0for macOS targets.c_checkis_iosstate withdarwin_os, which records the Darwintarget kind as
macOSoriOS.Darwin, while writingOSNAME_DISPLAYforuser-facing output.
CROSS=1when the detected Darwin target kind isiOS.grep -qwhen checking the generated assembly symbol prefix, avoidingaccidental diagnostic output from the detection command.
c_check.plc_checkbehavior in the Perl fallback script.darwin_osseparately fromOSNAME.OSNAME_DISPLAYonly for Darwin targets.MakefileOSNAME_DISPLAY ?= $(OSNAME).OSNAME_DISPLAYin the final build summary instead of the internalOSNAME.Darwin, while showing usersmacOSoriOSin the summary..github/workflows/apple_m.ymlxcrun.CCandCFLAGSdirectly tomake, instead of setting shell variablesthat
makewould not necessarily receive.CCandSDKROOTvalues in CI logs for easier debugging.DYNAMIC_ARCH=1in the iOS CI build command.docs/install.mdxcrun --sdk iphoneos --find clanginstead of a hard-coded Xcode path.CCandCFLAGSdirectly tomake.-miphoneos-version-minflag instead ofMIN_IOS_VERSION.