-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Making target detection on Mac more robust #2140
Conversation
Codecov Report
@@ Coverage Diff @@
## devel #2140 +/- ##
=======================================
Coverage 90.03% 90.03%
=======================================
Files 146 146
Lines 7089 7089
=======================================
Hits 6382 6382
Misses 707 707 |
Thanks for the PR, I have two notes.
#if (defined(TARGET_OS_X) && TARGET_OS_X == 1) ||
(define(TARGET_OS_MAC) && TARGET_OS_MAC == 1)
# define CATCH_PLATFORM_MAC
#elif < -- something for iphone platform -- >
|
Hi @horenmar . I didn't find amazing sources for the target detection, but I included one that seems the most official. For reference see also here . A note is that I never found the |
A question is: with this fix, how can be make v2.13.4 available for conda-forge? I didn't really get how the different branches are used, so I could't figure out how I could include patches in conda-forge's feedstock. Or will there simply be a patch release v2.13.5 soon, such that v2.13.4 can be skipped on conda-forge? |
If you want the fix to go to a version in v2.x major, you need to retarget the PR to The code changes look fine, so otherwise I am ready to merge this. |
I am going to close this, and port it later. |
#1084 explains why
Even replacing the typos of On my Mac with macOS 12, the comments at the top of the TargetConditionals.h file explain in text and diagram form the various macros that are available and what they mean: * TARGET_OS_WIN32 - Generated code will run under WIN32 API
* TARGET_OS_WINDOWS - Generated code will run under Windows
* TARGET_OS_UNIX - Generated code will run under some Unix (not OSX)
* TARGET_OS_LINUX - Generated code will run under Linux
* TARGET_OS_MAC - Generated code will run under Mac OS X variant
* TARGET_OS_OSX - Generated code will run under OS X devices
* TARGET_OS_IPHONE - Generated code for firmware, devices, or simulator
* TARGET_OS_IOS - Generated code will run under iOS
* TARGET_OS_TV - Generated code will run under Apple TV OS
* TARGET_OS_WATCH - Generated code will run under Apple Watch OS
* TARGET_OS_BRIDGE - Generated code will run under Bridge devices
* TARGET_OS_MACCATALYST - Generated code will run under macOS
* TARGET_OS_SIMULATOR - Generated code will run under a simulator
*
* TARGET_OS_EMBEDDED - DEPRECATED: Use TARGET_OS_IPHONE and/or TARGET_OS_SIMULATOR instead
* TARGET_IPHONE_SIMULATOR - DEPRECATED: Same as TARGET_OS_SIMULATOR
* TARGET_OS_NANO - DEPRECATED: Same as TARGET_OS_WATCH
*
* +---------------------------------------------------------------------+
* | TARGET_OS_MAC |
* | +---+ +-----------------------------------------------+ +---------+ |
* | | | | TARGET_OS_IPHONE | | | |
* | | | | +---------------+ +----+ +-------+ +--------+ | | | |
* | | | | | IOS | | | | | | | | | | |
* | |OSX| | |+-------------+| | TV | | WATCH | | BRIDGE | | |DRIVERKIT| |
* | | | | || MACCATALYST || | | | | | | | | | |
* | | | | |+-------------+| | | | | | | | | | |
* | | | | +---------------+ +----+ +-------+ +--------+ | | | |
* | +---+ +-----------------------------------------------+ +---------+ |
* +---------------------------------------------------------------------+ As you see, It is true that old versions of macOS (those that predate the introduction of the iPhone in 2007) don't have I say these things as someone familiar with macOS but unfamiliar with Catch2. |
Description
Upon encountering conda-forge/catch2-feedstock#37 if found that
TargetConditionals.h
may not define the usedTARGET_OS_OSX
, butTARGET_OS_MAC
is. Since it was changed the other way before it could be safest to test for both. Not an expert here, so it would be good if an expert could comment.I just realised that I could check if it fixes conda-forge/catch2-feedstock#37 , see conda-forge/catch2-feedstock#38 , if only I would understand how to get the right patch ;) I think that I failed because the release is not made on the main branch.
GitHub Issues
Fixes #2139