Skip to content

Commit 6c71c4a

Browse files
authored
Enable bitcode for iOS build. (#276)
Enable bitcode for Firebase C++ SDK build on iOS. Fixes issue #266.
1 parent 89ea89d commit 6c71c4a

File tree

13 files changed

+68
-68
lines changed

13 files changed

+68
-68
lines changed

admob/CMakeLists.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ set_property(TARGET firebase_admob PROPERTY FOLDER "Firebase Cpp")
8080

8181
# Set up the dependency on Firebase App.
8282
target_link_libraries(firebase_admob
83-
firebase_app)
83+
PUBLIC firebase_app)
8484
# Public headers all refer to each other relative to the src/include directory,
8585
# while private headers are relative to the entire C++ SDK directory.
8686
target_include_directories(firebase_admob
@@ -104,11 +104,11 @@ if(ANDROID)
104104
firebase_cpp_proguard_file(admob)
105105
elseif(IOS)
106106
# AdMob for iOS uses weak references, which requires enabling Automatic
107-
# Reference Counting (ARC).
108-
set_property(
109-
TARGET firebase_admob
110-
APPEND_STRING PROPERTY
111-
COMPILE_FLAGS "-fobjc-arc")
107+
# Reference Counting (ARC). Also enable BitCode.
108+
target_compile_options(firebase_admob
109+
PUBLIC "-fobjc-arc" "-fembed-bitcode")
110+
target_link_libraries(firebase_admob
111+
PUBLIC "-fembed-bitcode")
112112

113113
setup_pod_headers(
114114
firebase_admob

analytics/CMakeLists.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ set_property(TARGET firebase_analytics PROPERTY FOLDER "Firebase Cpp")
9090

9191
# Set up the dependency on Firebase App.
9292
target_link_libraries(firebase_analytics
93-
firebase_app)
93+
PUBLIC firebase_app)
9494
# Public headers all refer to each other relative to the src/include directory,
9595
# while private headers are relative to the entire C++ SDK directory.
9696
target_include_directories(firebase_analytics
@@ -115,11 +115,11 @@ endif()
115115
if(ANDROID)
116116
firebase_cpp_proguard_file(analytics)
117117
elseif(IOS)
118-
# Enable Automatic Reference Counting (ARC).
119-
set_property(
120-
TARGET firebase_analytics
121-
APPEND_STRING PROPERTY
122-
COMPILE_FLAGS "-fobjc-arc")
118+
# Enable Automatic Reference Counting (ARC) and Bitcode.
119+
target_compile_options(firebase_analytics
120+
PUBLIC "-fobjc-arc" "-fembed-bitcode")
121+
target_link_libraries(firebase_analytics
122+
PUBLIC "-fembed-bitcode")
123123

124124
setup_pod_headers(
125125
firebase_analytics

app/CMakeLists.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -366,11 +366,11 @@ endif()
366366
if(ANDROID)
367367
firebase_cpp_proguard_file(app)
368368
elseif(IOS)
369-
# Enable Automatic Reference Counting (ARC).
370-
set_property(
371-
TARGET firebase_app
372-
APPEND_STRING PROPERTY
373-
COMPILE_FLAGS "-fobjc-arc")
369+
# Enable Automatic Reference Counting (ARC) and Bitcode.
370+
target_compile_options(firebase_app
371+
PUBLIC "-fobjc-arc" "-fembed-bitcode")
372+
target_link_libraries(firebase_app
373+
PUBLIC "-fembed-bitcode")
374374

375375
# Add empty include path to get root include folder '.'
376376
setup_pod_headers(

auth/CMakeLists.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -188,11 +188,11 @@ endif()
188188
if(ANDROID)
189189
firebase_cpp_proguard_file(auth)
190190
elseif(IOS)
191-
# Enable Automatic Reference Counting (ARC).
192-
set_property(
193-
TARGET firebase_auth
194-
APPEND_STRING PROPERTY
195-
COMPILE_FLAGS "-fobjc-arc")
191+
# Enable Automatic Reference Counting (ARC) and Bitcode.
192+
target_compile_options(firebase_auth
193+
PUBLIC "-fobjc-arc" "-fembed-bitcode")
194+
target_link_libraries(firebase_auth
195+
PUBLIC "-fembed-bitcode")
196196

197197
setup_pod_headers(
198198
firebase_auth

database/CMakeLists.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -227,11 +227,11 @@ endif()
227227
if(ANDROID)
228228
firebase_cpp_proguard_file(database)
229229
elseif(IOS)
230-
# Enable Automatic Reference Counting (ARC)
231-
set_property(
232-
TARGET firebase_database
233-
APPEND_STRING PROPERTY
234-
COMPILE_FLAGS "-fobjc-arc")
230+
# Enable Automatic Reference Counting (ARC) and Bitcode.
231+
target_compile_options(firebase_database
232+
PUBLIC "-fobjc-arc" "-fembed-bitcode")
233+
target_link_libraries(firebase_database
234+
PUBLIC "-fembed-bitcode")
235235

236236
setup_pod_headers(
237237
firebase_database

dynamic_links/CMakeLists.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ set_property(TARGET firebase_dynamic_links PROPERTY FOLDER "Firebase Cpp")
5151

5252
# Set up the dependency on Firebase App.
5353
target_link_libraries(firebase_dynamic_links
54-
firebase_app)
54+
PUBLIC firebase_app)
5555
# Public headers all refer to each other relative to the src/include directory,
5656
# while private headers are relative to the entire C++ SDK directory.
5757
target_include_directories(firebase_dynamic_links
@@ -74,11 +74,11 @@ endif()
7474
if(ANDROID)
7575
firebase_cpp_proguard_file(dynamic_links)
7676
elseif(IOS)
77-
# Enable Automatic Reference Counting (ARC).
78-
set_property(
79-
TARGET firebase_dynamic_links
80-
APPEND_STRING PROPERTY
81-
COMPILE_FLAGS "-fobjc-arc")
77+
# Enable Automatic Reference Counting (ARC) and Bitcode.
78+
target_compile_options(firebase_dynamic_links
79+
PUBLIC "-fobjc-arc" "-fembed-bitcode")
80+
target_link_libraries(firebase_dynamic_links
81+
PUBLIC "-fembed-bitcode")
8282

8383
setup_pod_headers(
8484
firebase_dynamic_links

firestore/CMakeLists.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -332,11 +332,11 @@ if(ANDROID)
332332
firebase_cpp_proguard_file(firestore)
333333

334334
elseif(IOS)
335-
# Enable Automatic Reference Counting (ARC).
336-
set_property(
337-
TARGET firebase_firestore
338-
APPEND_STRING PROPERTY
339-
COMPILE_FLAGS "-fobjc-arc")
335+
# Enable Automatic Reference Counting (ARC) and Bitcode.
336+
target_compile_options(firebase_firestore
337+
PUBLIC "-fobjc-arc" "-fembed-bitcode")
338+
target_link_libraries(firebase_firestore
339+
PUBLIC "-fembed-bitcode")
340340

341341
setup_pod_headers(
342342
firebase_firestore

functions/CMakeLists.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,11 @@ endif()
9090
if(ANDROID)
9191
firebase_cpp_proguard_file(functions)
9292
elseif(IOS)
93-
# Enable Automatic Reference Counting (ARC).
94-
set_property(
95-
TARGET firebase_functions
96-
APPEND_STRING PROPERTY
97-
COMPILE_FLAGS "-fobjc-arc")
93+
# Enable Automatic Reference Counting (ARC) and Bitcode.
94+
target_compile_options(firebase_functions
95+
PUBLIC "-fobjc-arc" "-fembed-bitcode")
96+
target_link_libraries(firebase_functions
97+
PUBLIC "-fembed-bitcode")
9898

9999
setup_pod_headers(
100100
firebase_functions

installations/CMakeLists.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,11 @@ endif()
7474
if(ANDROID)
7575
firebase_cpp_proguard_file(installations)
7676
elseif(IOS)
77-
# Enable Automatic Reference Counting (ARC).
78-
set_property(
79-
TARGET firebase_installations
80-
APPEND_STRING PROPERTY
81-
COMPILE_FLAGS "-fobjc-arc")
77+
# Enable Automatic Reference Counting (ARC) and Bitcode.
78+
target_compile_options(firebase_installations
79+
PUBLIC "-fobjc-arc" "-fembed-bitcode")
80+
target_link_libraries(firebase_installations
81+
PUBLIC "-fembed-bitcode")
8282

8383
setup_pod_headers(
8484
firebase_installations

instance_id/CMakeLists.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,11 @@ endif()
8787
if(ANDROID)
8888
firebase_cpp_proguard_file(instance_id)
8989
elseif(IOS)
90-
# Enable Automatic Reference Counting (ARC).
91-
set_property(
92-
TARGET firebase_instance_id
93-
APPEND_STRING PROPERTY
94-
COMPILE_FLAGS "-fobjc-arc")
90+
# Enable Automatic Reference Counting (ARC) and Bitcode.
91+
target_compile_options(firebase_instance_id
92+
PUBLIC "-fobjc-arc" "-fembed-bitcode")
93+
target_link_libraries(firebase_instance_id
94+
PUBLIC "-fembed-bitcode")
9595

9696
setup_pod_headers(
9797
firebase_instance_id

messaging/CMakeLists.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,11 @@ endif()
110110
if(ANDROID)
111111
firebase_cpp_proguard_file(messaging)
112112
elseif(IOS)
113-
# Enable Automatic Reference Counting (ARC).
114-
set_property(
115-
TARGET firebase_messaging
116-
APPEND_STRING PROPERTY
117-
COMPILE_FLAGS "-fobjc-arc")
113+
# Enable Automatic Reference Counting (ARC) and Bitcode.
114+
target_compile_options(firebase_messaging
115+
PUBLIC "-fobjc-arc" "-fembed-bitcode")
116+
target_link_libraries(firebase_messaging
117+
PUBLIC "-fembed-bitcode")
118118

119119
setup_pod_headers(
120120
firebase_messaging

remote_config/CMakeLists.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -155,11 +155,11 @@ endif()
155155
if(ANDROID)
156156
firebase_cpp_proguard_file(remote_config)
157157
elseif(IOS)
158-
# Enable Automatic Reference Counting (ARC).
159-
set_property(
160-
TARGET firebase_remote_config
161-
APPEND_STRING PROPERTY
162-
COMPILE_FLAGS "-fobjc-arc")
158+
# Enable Automatic Reference Counting (ARC) and Bitcode.
159+
target_compile_options(firebase_remote_config
160+
PUBLIC "-fobjc-arc" "-fembed-bitcode")
161+
target_link_libraries(firebase_remote_config
162+
PUBLIC "-fembed-bitcode")
163163

164164
setup_pod_headers(
165165
firebase_remote_config

storage/CMakeLists.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,11 @@ endif()
118118
if(ANDROID)
119119
firebase_cpp_proguard_file(storage)
120120
elseif(IOS)
121-
# Enable Automatic Reference Counting (ARC)
122-
set_property(
123-
TARGET firebase_storage
124-
APPEND_STRING PROPERTY
125-
COMPILE_FLAGS "-fobjc-arc")
121+
# Enable Automatic Reference Counting (ARC) and Bitcode.
122+
target_compile_options(firebase_storage
123+
PUBLIC "-fobjc-arc" "-fembed-bitcode")
124+
target_link_libraries(firebase_storage
125+
PUBLIC "-fembed-bitcode")
126126

127127
# Empty entry to point to the GTMSessionFetcher folder '.'
128128
setup_pod_headers(

0 commit comments

Comments
 (0)