Parcourir la source

Add FIRESTORE_INCLUDE_OBJC cmake cache variable to provide a way to avoid building the Firestore Objective-C layer. (#9658)

Denver Coneybeare il y a 4 ans
Parent
commit
caac2ceeed

+ 4 - 0
Firestore/CMakeLists.txt

@@ -12,6 +12,10 @@
 # See the License for the specific language governing permissions and
 # See the License for the specific language governing permissions and
 # limitations under the License.
 # limitations under the License.
 
 
+# Provide a mechanism for firebase-cpp-sdk to avoid unnecessarily building
+# the Objective-C APIs and Tests, which it doesn't use.
+option(FIRESTORE_INCLUDE_OBJC "Build the Firestore Objective-C layer" ON)
+
 add_subdirectory(Protos)
 add_subdirectory(Protos)
 add_subdirectory(Source)
 add_subdirectory(Source)
 add_subdirectory(core)
 add_subdirectory(core)

+ 4 - 0
Firestore/Example/CMakeLists.txt

@@ -12,6 +12,10 @@
 # See the License for the specific language governing permissions and
 # See the License for the specific language governing permissions and
 # limitations under the License.
 # limitations under the License.
 
 
+if(NOT FIRESTORE_INCLUDE_OBJC)
+  return()
+endif()
+
 add_subdirectory(Benchmarks)
 add_subdirectory(Benchmarks)
 
 
 add_subdirectory(App)
 add_subdirectory(App)

+ 4 - 0
Firestore/Source/CMakeLists.txt

@@ -16,6 +16,10 @@ if(NOT APPLE)
   return()
   return()
 endif()
 endif()
 
 
+if(NOT FIRESTORE_INCLUDE_OBJC)
+  return()
+endif()
+
 file(GLOB headers Public/FirebaseFirestore/*.h)
 file(GLOB headers Public/FirebaseFirestore/*.h)
 file(GLOB sources API/*.h API/*.m API/*.mm)
 file(GLOB sources API/*.h API/*.m API/*.mm)