Support for conditional platform symbols (`TARGET_OS_XXX`)

Description

None

Environment

None

Activity

Show:
Alex Petuschak
August 10, 2020, 2:05 PM

Assigned this to you for grouping only. Ignore for now.

Alex Petuschak
August 10, 2020, 2:09 PM

Just realized you've implemented this in `Backup/AvailabilitySupport` branch.

Dmitry Rassadin
August 11, 2020, 12:48 AM

Yeap, I’ve implemented some of them. However, I don’t know how to classify such directives:

  • TARGET_OS_WIN32

  • TARGET_OS_UNIX

  • TARGET_OS_BRIDGE

  • TARGET_OS_SIMULATOR

  • TARGET_OS_EMBEDDED

  • TARGET_IPHONE_SIMULATOR

  • TARGET_OS_NANO

  • all started with TARGET_CPU* and TARGET_RT*

According to the documentation simulator directives should be converted into targetEnviroment(simulator)condition.

Alex Petuschak
August 12, 2020, 4:14 PM
Edited

I’ve created this sample playground with values for your requests: https://take.ms/myQJV

Note: for TARGET_OS_EMBEDDEDI can’t find an exact alternative, so keep the comment in the Swift output:

#if os(macOS) /* TARGET_OS_EMBEDDED */

or (if easier):

#if os(macOS /* TARGET_OS_EMBEDDED */)

 

TARGET_CPU* and TARGET_RT* - I haven’t seen them a lot myself, so let’s postpone for now.

Assignee

Dmitry Rassadin

Reporter

Alex Petuschak

Labels

None

Git Branch Name

Backup/AvailabilitySupport

GitHub Issue

None

Components

Fix versions

Priority

Medium
Configure