docs: Clarify conditional compilation restrictions with an example
https://skip.tools/docs/platformcustomization/#compiler-directives includes this warning:
Because the Skip tooling does not know the value of any symbols other than
os(Android)and!os(Android), we strongly recommend addingos(Android)or!os(Android)conditions to all#ifblocks, so that it is clear whether Skip should include or exclude the code for Android.
That line made no sense at all to me when I read it.
What it means to say is that #if !os(macOS) won't work, which is filed as #342. You have to rewrite it as #if !os(macOS) || os(Android).
The documentation would be much clearer with an example of issue #342 and the recommended workaround.
For example, this won't work, because Skip doesn't understand the symbol
os(macOS), or its negation!os(macOS).Text("Hello World") #if !os(macOS) // BUG this won't run on Android .italic() #endifInstead, use an "unnecessary"
os(Android):Text("Hello World") #if !os(macOS) || os(Android) .italic() #endifWe hope to address this issue in a future version of Skip.