Skip to content

Commit 6c0abc9

Browse files
markchandlera-maurice
authored andcommitted
Firebase unity: Fixed ios builds of unity sdk
PiperOrigin-RevId: 281389916
1 parent 9da3cfc commit 6c0abc9

File tree

3 files changed

+24
-12
lines changed

3 files changed

+24
-12
lines changed

cmake/external/uWebSockets.cmake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ ExternalProject_Add(
2323

2424
GIT_REPOSITORY https://github.com/uNetworking/uWebSockets
2525
GIT_TAG 4d94401b9c98346f9afd838556fdc7dce30561eb
26-
GIT_SHALLOW 1
2726

2827
PREFIX ${PROJECT_BINARY_DIR}
2928

ios_pod/CMakeLists.txt

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,12 @@ if(NOT IOS)
1616
return()
1717
endif()
1818

19-
set(FIREBASE_POD_DIR ${CMAKE_CURRENT_BINARY_DIR})
19+
# Add these two vars to the cache to make them avaliable in global scope
20+
set(FIREBASE_POD_DIR ${CMAKE_CURRENT_BINARY_DIR} CACHE STRING "")
21+
set(FIREBASE_POD_HEADER_DIR
22+
"${FIREBASE_POD_DIR}/Pods/Headers/Public"
23+
CACHE STRING ""
24+
)
2025

2126
# Copy build files to trigger pod install as it requires a valid Xcode project
2227
file(
@@ -44,11 +49,6 @@ execute_process(
4449

4550
message("${pods_output}")
4651

47-
set(FIREBASE_POD_DIR ${FIREBASE_POD_DIR} PARENT_SCOPE)
48-
set(FIREBASE_POD_HEADER_DIR
49-
"${CMAKE_CURRENT_BINARY_DIR}/Pods/Headers/Public"
50-
PARENT_SCOPE
51-
)
5252

5353

5454
# Sets up a target to have the correct dependencie on the install pods target
@@ -87,24 +87,38 @@ endfunction()
8787
# include paths are expecting the header files to be in a subdirectory, when
8888
# accessing the header files directly does not have them in the same structure.
8989
#
90-
# Usage: symlink_pod_headers(<target_name> <pod_name> <dir_name>)
90+
# Usage: symlink_pod_headers(<target_name> <pod_name> <dir_name>
91+
# [FRAMEWORK_DIR_NAME <framework_dir>]
92+
# )
9193
#
9294
# Args:
9395
# target_name: Name of target to add includes to
9496
# pod_name: Name of the pod in the Podfile
9597
# dir_name: Name of the dir for the symlink (most cases should be same as pod_name)
98+
# framework_dir: Set if pod uses a different folder name for frameworks
9699
#
97100
function(symlink_pod_headers target_name pod_name dir_name)
98101

102+
set(multi OUTPUT_NAME FRAMEWORK_DIR_NAME)
103+
104+
# Parse the arguments into SYMLINK_POD_FRAMEWORK_DIR_NAME.
105+
cmake_parse_arguments(SYMLINK_POD "" "" "${multi}" ${ARGN})
106+
107+
set(FRAMEWORK_DIR "Frameworks")
108+
109+
if(NOT "${SYMLINK_POD_FRAMEWORK_DIR_NAME}" STREQUAL "")
110+
set(FRAMEWORK_DIR "${SYMLINK_POD_FRAMEWORK_DIR_NAME}")
111+
endif()
112+
99113
set(gen_file ${CMAKE_CURRENT_BINARY_DIR}/pod_sym_links/gen_${dir_name}.txt)
100114
set(symlink_dir ${CMAKE_CURRENT_BINARY_DIR}/pod_sym_links/${dir_name})
101-
set(glob_dir "${FIREBASE_POD_DIR}/Pods/${pod_name}/Frameworks/*/*.framework/Headers")
115+
set(glob_dir "${FIREBASE_POD_DIR}/Pods/${pod_name}/${FRAMEWORK_DIR}/*/*.framework/Headers")
102116

103117
file(GLOB framework_dir ${glob_dir})
104118

105119
# If failed to find headers, try again one folder up
106120
if(NOT EXISTS ${framework_dir})
107-
set(glob_dir "${FIREBASE_POD_DIR}/Pods/${pod_name}/Frameworks/*.framework/Headers")
121+
set(glob_dir "${FIREBASE_POD_DIR}/Pods/${pod_name}/${FRAMEWORK_DIR}/*.framework/Headers")
108122
file(GLOB framework_dir ${glob_dir})
109123
endif()
110124

remote_config/CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@ else()
4949
src/desktop/remote_config_desktop.cc
5050
src/desktop/rest_nanopb_decode.cc
5151
src/desktop/rest_nanopb_encode.cc
52-
"${PROJECT_BINARY_DIR}/config.pb.c"
53-
"${PROJECT_BINARY_DIR}/config.pb.h")
52+
)
5453
endif()
5554

5655
if(ANDROID)

0 commit comments

Comments
 (0)