Skip to content

Commit cc15c76

Browse files
wilhuffa-maurice
authored andcommitted
Actually add the Firestore CMakeLists.txt
This completes the work in cl/297731635. PiperOrigin-RevId: 297922469
1 parent dda9321 commit cc15c76

File tree

1 file changed

+192
-0
lines changed

1 file changed

+192
-0
lines changed

firestore/CMakeLists.txt

Lines changed: 192 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,192 @@
1+
# Copyright 2020 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
set(common_SRCS
16+
src/common/cleanup.h
17+
src/common/collection_reference.cc
18+
src/common/document_change.cc
19+
src/common/document_reference.cc
20+
src/common/document_snapshot.cc
21+
src/common/field_path.cc
22+
src/common/field_value.cc
23+
src/common/firestore.cc
24+
src/common/futures.h
25+
src/common/listener_registration.cc
26+
src/common/main_for_testing_build.cc
27+
src/common/query.cc
28+
src/common/query_snapshot.cc
29+
src/common/set_options.cc
30+
src/common/settings.cc
31+
src/common/settings_ios.mm
32+
src/common/snapshot_metadata.cc
33+
src/common/to_string.cc
34+
src/common/to_string.h
35+
src/common/transaction.cc
36+
src/common/util.cc
37+
src/common/util.h
38+
src/common/write_batch.cc)
39+
40+
set(android_SRCS
41+
src/android/blob_android.cc
42+
src/android/blob_android.h
43+
src/android/collection_reference_android.cc
44+
src/android/collection_reference_android.h
45+
src/android/direction_android.cc
46+
src/android/direction_android.h
47+
src/android/document_change_android.cc
48+
src/android/document_change_android.h
49+
src/android/document_change_type_android.cc
50+
src/android/document_change_type_android.h
51+
src/android/document_reference_android.cc
52+
src/android/document_reference_android.h
53+
src/android/document_snapshot_android.cc
54+
src/android/document_snapshot_android.h
55+
src/android/event_listener_android.cc
56+
src/android/event_listener_android.h
57+
src/android/field_path_android.cc
58+
src/android/field_path_android.h
59+
src/android/field_path_portable.cc
60+
src/android/field_path_portable.h
61+
src/android/field_value_android.cc
62+
src/android/field_value_android.h
63+
src/android/firebase_firestore_exception_android.cc
64+
src/android/firebase_firestore_exception_android.h
65+
src/android/firebase_firestore_settings_android.cc
66+
src/android/firebase_firestore_settings_android.h
67+
src/android/firestore_android.cc
68+
src/android/firestore_android.h
69+
src/android/geo_point_android.cc
70+
src/android/geo_point_android.h
71+
src/android/geo_point_portable.cc
72+
src/android/lambda_event_listener.h
73+
src/android/lambda_transaction_function.h
74+
src/android/listener_registration_android.cc
75+
src/android/listener_registration_android.h
76+
src/android/metadata_changes_android.cc
77+
src/android/metadata_changes_android.h
78+
src/android/promise_android.h
79+
src/android/query_android.cc
80+
src/android/query_android.h
81+
src/android/query_snapshot_android.cc
82+
src/android/query_snapshot_android.h
83+
src/android/server_timestamp_behavior_android.cc
84+
src/android/server_timestamp_behavior_android.h
85+
src/android/set_options_android.cc
86+
src/android/set_options_android.h
87+
src/android/snapshot_metadata_android.cc
88+
src/android/snapshot_metadata_android.h
89+
src/android/source_android.cc
90+
src/android/source_android.h
91+
src/android/timestamp_android.cc
92+
src/android/timestamp_android.h
93+
src/android/timestamp_portable.cc
94+
src/android/transaction_android.cc
95+
src/android/transaction_android.h
96+
src/android/util_android.h
97+
src/android/wrapper.cc
98+
src/android/wrapper.h
99+
src/android/wrapper_future.h
100+
src/android/write_batch_android.cc
101+
src/android/write_batch_android.h)
102+
103+
set(ios_SRCS
104+
src/ios/collection_reference_ios.cc
105+
src/ios/collection_reference_ios.h
106+
src/ios/converter_ios.h
107+
src/ios/credentials_provider_ios.cc
108+
src/ios/credentials_provider_ios.h
109+
src/ios/document_change_ios.cc
110+
src/ios/document_change_ios.h
111+
src/ios/document_reference_ios.cc
112+
src/ios/document_reference_ios.h
113+
src/ios/document_snapshot_ios.cc
114+
src/ios/document_snapshot_ios.h
115+
src/ios/field_value_ios.cc
116+
src/ios/field_value_ios.h
117+
src/ios/firebase_firestore_settings_ios.cc
118+
src/ios/firebase_firestore_settings_ios.h
119+
src/ios/firestore_ios.cc
120+
src/ios/firestore_ios.h
121+
src/ios/hard_assert_ios.cc
122+
src/ios/hard_assert_ios.h
123+
src/ios/listener_ios.h
124+
src/ios/listener_registration_ios.cc
125+
src/ios/listener_registration_ios.h
126+
src/ios/promise_factory_ios.h
127+
src/ios/promise_ios.h
128+
src/ios/query_ios.cc
129+
src/ios/query_ios.h
130+
src/ios/query_snapshot_ios.cc
131+
src/ios/query_snapshot_ios.h
132+
src/ios/set_options_ios.h
133+
src/ios/source_ios.h
134+
src/ios/transaction_ios.cc
135+
src/ios/transaction_ios.h
136+
src/ios/user_data_converter_ios.cc
137+
src/ios/user_data_converter_ios.h
138+
src/ios/util_ios.h
139+
src/ios/write_batch_ios.cc
140+
src/ios/write_batch_ios.h)
141+
142+
set(wrapper_assertions_SRCS
143+
src/common/wrapper_assertions.cc
144+
src/common/wrapper_assertions.h)
145+
146+
if(ANDROID)
147+
set(firestore_platform_SRCS "${android_SRCS}")
148+
else()
149+
# The iOS implementation is actually portable to desktop environments as
150+
# well.
151+
set(firestore_platform_SRCS "${ios_SRCS}")
152+
endif()
153+
154+
add_library(firebase_firestore STATIC
155+
${common_SRCS}
156+
${firestore_platform_SRCS})
157+
158+
set_property(TARGET firebase_firestore PROPERTY FOLDER "Firebase Cpp")
159+
160+
# Set up the dependency on Firebase App.
161+
target_link_libraries(firebase_firestore
162+
PUBLIC
163+
firebase_app
164+
firebase_auth
165+
PRIVATE
166+
firebase_firestore_api
167+
)
168+
169+
170+
# Public headers all refer to each other relative to the src/include directory,
171+
# while private headers are relative to the entire C++ SDK directory.
172+
target_include_directories(firebase_firestore
173+
PUBLIC
174+
${CMAKE_CURRENT_LIST_DIR}/src/include
175+
${FIRESTORE_SOURCE_DIR}/Firestore/core/include
176+
PRIVATE
177+
${FIREBASE_CPP_SDK_ROOT_DIR}
178+
)
179+
180+
if(ANDROID)
181+
firebase_cpp_proguard_file(firestore)
182+
183+
elseif(IOS)
184+
# Enable Automatic Reference Counting (ARC).
185+
set_property(
186+
TARGET firebase_firestore
187+
APPEND_STRING PROPERTY
188+
COMPILE_FLAGS "-fobjc-arc")
189+
endif()
190+
191+
cpp_pack_library(firebase_firestore "")
192+
cpp_pack_public_headers()

0 commit comments

Comments
 (0)