Skip to content

Conversation

dconeybe
Copy link
Contributor

If this new FIRESTORE_INCLUDE_OBJC cmake cache variable is set to a false value (e.g. "NO", "OFF") then the Source and Example subdirectories of Firestore will not be compiled. The default value is true.

This new cmake cache variable will be used by the firebase-cpp-sdk repository to avoid unnecessarily compiling the objective-c sources that it does not use. The immediate motivation is to work around the following compilation error in firebase-cpp-sdk:

FIRFirestore.h:147:20: error: unknown attribute 'swift_async' ignored [-Werror,-Wunknown-attributes]
    __attribute__((swift_async(none)));  // Disable async import due to #9426.
                   ^
1 error generated.

e.g. https://github.com/firebase/firebase-cpp-sdk/runs/6033445422

This problematic usage of swift_async was added in #9502. Instead of trying to fix the build error when compiled by the firebase-cpp-sdk, it's easier to just disable compiling this code all together.

#no-changelog

…void building the Firestore Objective-C layer.
@dconeybe dconeybe force-pushed the dconeybe/FirestoreInlucdeObjcCmakeCacheVar branch from 3c718c3 to 6a05ffd Compare April 15, 2022 14:18
@google-oss-bot
Copy link

google-oss-bot commented Apr 15, 2022

Coverage Report 1

Affected Products

  • FirebaseFirestore-iOS-FirebaseFirestore.framework

    Overall coverage changed from 86.73% (58a5c8a) to 86.73% (6accd53) by +0.00%.

    FilenameBase (58a5c8a)Merge (6accd53)Diff
    exception.cc73.68%23.68%-50.00%
    exception_apple.mm58.62%89.66%+31.03%
    leveldb_key.cc97.73%98.38%+0.65%
    task.cc93.04%94.78%+1.74%
    write_stream.cc90.14%94.37%+4.23%

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/L0Ce5DqgNd.html

@schmidt-sebastian schmidt-sebastian removed their assignment Apr 15, 2022
@dconeybe dconeybe merged commit caac2ce into master Apr 15, 2022
@dconeybe dconeybe deleted the dconeybe/FirestoreInlucdeObjcCmakeCacheVar branch April 15, 2022 16:41
dconeybe added a commit to firebase/firebase-cpp-sdk that referenced this pull request Apr 15, 2022
…g Objective-C parts of the iOS SDK.

This won't have any effects until the iOS dependencies are updated to a version that includes firebase/firebase-ios-sdk#9658.

This will fix the following build error:

```
FIRFirestore.h:147:20: error: unknown attribute 'swift_async' ignored [-Werror,-Wunknown-attributes]
    __attribute__((swift_async(none)));  // Disable async import due to #9426.
                   ^
1 error generated.
```

which was introduced by firebase/firebase-ios-sdk#9502.

It avoids it by simply not building the file at all :)
@firebase firebase locked and limited conversation to collaborators May 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants