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

Fix platform detection for iOS #1084

Merged
merged 1 commit into from
Nov 6, 2017

Conversation

doubleday
Copy link

Platform detection fails for iOS resulting in compile error.

The TARGET_OS_MAC is a super category of TARGET_OS_OSX and TARGET_OS_IPHONE thus CATCH_PLATFORM_IPHONE is never selected.

From apple docs:

    TARGET_OS_* 
    These conditionals specify in which Operating System the generated code will
    run.  Indention is used to show which conditionals are evolutionary subclasses.  
    
    The MAC/WIN32/UNIX conditionals are mutually exclusive.
    The IOS/TV/WATCH conditionals are mutually exclusive.
    
    
        TARGET_OS_WIN32           - Generated code will run under 32-bit Windows
        TARGET_OS_UNIX            - Generated code will run under some Unix (not OSX) 
        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_SIMULATOR      - Generated code will run under a simulator
           TARGET_OS_EMBEDDED       - Generated code for firmware
       
        TARGET_IPHONE_SIMULATOR   - DEPRECATED: Same as TARGET_OS_SIMULATOR
        TARGET_OS_NANO            - DEPRECATED: Same as TARGET_OS_WATCH

      +------------------------------------------------+
      |                TARGET_OS_MAC                   |
      | +---+  +-------------------------------------+ |
      | |   |  |          TARGET_OS_IPHONE           | |
      | |OSX|  | +-----+ +----+ +-------+ +--------+ | |
      | |   |  | | IOS | | TV | | WATCH | | BRIDGE | | |
      | |   |  | +-----+ +----+ +-------+ +--------+ | |
      | +---+  +-------------------------------------+ |
      +------------------------------------------------+

@horenmar
Copy link
Member

horenmar commented Nov 5, 2017

Can you add link to the docs?

@doubleday
Copy link
Author

Well I just copied them from the header.

@doubleday
Copy link
Author

But if you don't have access to a MAC this is one version for iOS:
https://github.com/mstg/iOS-full-sdk/blob/master/iPhoneOS9.3.sdk/usr/include/TargetConditionals.h

@horenmar
Copy link
Member

horenmar commented Nov 6, 2017

I don't actually have a Mac.

Thanks

@horenmar horenmar merged commit e28763a into catchorg:master Nov 6, 2017
@doubleday doubleday deleted the fix/iosplatformdetection branch November 6, 2017 09:09
arkivm added a commit to arkivm/rlbox_sandboxing_api that referenced this pull request Dec 29, 2021
v2.9.1 of catch2 fails to compile on apple m1 due to this
catchorg/Catch2#1084
arkivm added a commit to arkivm/rlbox_sandboxing_api that referenced this pull request Dec 29, 2021
v2.9.1 of catch2 fails to compile on apple m1 due to this
catchorg/Catch2#1084
shravanrn pushed a commit to PLSysSec/rlbox that referenced this pull request Dec 29, 2021
v2.9.1 of catch2 fails to compile on apple m1 due to this
catchorg/Catch2#1084
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants