File tree Expand file tree Collapse file tree 4 files changed +42
-2
lines changed Expand file tree Collapse file tree 4 files changed +42
-2
lines changed Original file line number Diff line number Diff line change @@ -129,6 +129,14 @@ if(IOS)
129
129
PRIVATE
130
130
${base_header_dir} /Google-Mobile-Ads-SDK
131
131
)
132
+ string (CONCAT google_mobile_ads_framework_path
133
+ "${pods_dir} /Pods/Google-Mobile-Ads-SDK/"
134
+ "Frameworks/GoogleMobileAdsFramework-Current/GoogleMobileAds.framework" )
135
+ # AdMob expects the header files to be in a subfolder, so set up a symlink to
136
+ # accomplish that.
137
+ symlink_framework_headers (firebase_admob ${pod_target_name}
138
+ ${google_mobile_ads_framework_path} GoogleMobileAds
139
+ )
132
140
133
141
# Add a dependency to downloading the headers onto admob.
134
142
add_dependencies (firebase_admob ${pod_target_name} )
Original file line number Diff line number Diff line change @@ -139,10 +139,12 @@ if(IOS)
139
139
140
140
# Add the Cocoapod headers to the include directories
141
141
set (base_header_dir "${pods_dir} /Pods/Headers/Public" )
142
+ set (analytics_framework_path
143
+ "${pods_dir} /Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework" )
142
144
target_include_directories (firebase_analytics
143
145
PRIVATE
144
146
${base_header_dir} /FirebaseCore
145
- ${base_header_dir} /FirebaseAnalytics/FirebaseAnalytics
147
+ ${analytics_framework_path} /Headers
146
148
)
147
149
148
150
# Add a dependency to downloading the headers onto analytics.
Original file line number Diff line number Diff line change @@ -77,3 +77,33 @@ function(setup_pod_headers_target TARGET_NAME POD_DIR POD_LIST)
77
77
)
78
78
79
79
endfunction ()
80
+
81
+ # Creates a symlink to the header files of the given framework. Used when
82
+ # include paths are expecting the header files to be in a subdirectory, when
83
+ # accessing the header files directly does not have them in the same structure.
84
+ #
85
+ # Args:
86
+ # LIBRARY_TARGET: The library to add the include directory to.
87
+ # DOWNLOAD_POD_TARGET: The target that downloads the pod files which will
88
+ # contain the framework. From the above function.
89
+ # FRAMEWORK_PATH: The full path to the framework.
90
+ # SYMLINK_NAME: The name of the symlink to use. Usually the framework name.
91
+ function (symlink_framework_headers LIBRARY_TARGET DOWNLOAD_POD_TARGET
92
+ FRAMEWORK_PATH SYMLINK_NAME )
93
+ # Guarantee the directory exists
94
+ set (HEADER_DIR "${PROJECT_BINARY_DIR} /FrameworkHeaders" )
95
+ file (MAKE_DIRECTORY "${HEADER_DIR} " )
96
+
97
+ # Create a symlink to the headers
98
+ add_custom_command (TARGET ${DOWNLOAD_POD_TARGET}
99
+ POST_BUILD
100
+ COMMAND ln -sf ${FRAMEWORK_PATH} /Headers ${HEADER_DIR} /${SYMLINK_NAME}
101
+ COMMENT "Setting up the framework header directory for ${SYMLINK_NAME} ."
102
+ )
103
+
104
+ # Add the symlink directory to the list of includes
105
+ target_include_directories (${LIBRARY_TARGET}
106
+ PRIVATE
107
+ ${HEADER_DIR}
108
+ )
109
+ endfunction ()
Original file line number Diff line number Diff line change @@ -140,7 +140,7 @@ if(IOS)
140
140
target_include_directories (firebase_remote_config
141
141
PRIVATE
142
142
${base_header_dir} /FirebaseCore
143
- ${base_header_dir} /FirebaseRemoteConfig/FirebaseRemoteConfig
143
+ ${base_header_dir} /FirebaseRemoteConfig
144
144
)
145
145
146
146
# Add a dependency to downloading the headers onto remote_config.
You can’t perform that action at this time.
0 commit comments