@@ -46,14 +46,33 @@ function(generate_dependencies_xml module)
4646
4747 set (options SKIP_INSTALL)
4848 set (single ANDROID_SPEC)
49- set (multi IOS_DEPS ANDROID_DEPS)
49+ set (multi IOS_DEPS ANDROID_DEPS FIREBASE_SPM_DEPS )
5050 # Parse the arguments into GEN_DEPS_IOS_DEPS, etc.
5151 cmake_parse_arguments (GEN_DEPS "${options} " "${single} " "${multi} " ${ARGN} )
5252
5353 set (MODULE_NAME ${module} )
5454 set (IOS_PODS "" )
5555 set (INDENT " " )
5656
57+ set (FIREBASE_SPM_PACKAGES "" )
58+ if (GEN_DEPS_FIREBASE_SPM_DEPS)
59+ foreach (SPM_DEP ${GEN_DEPS_FIREBASE_SPM_DEPS} )
60+ string (REPLACE "|" ";" DEP_LIST ${SPM_DEP} )
61+ list (GET DEP_LIST 0 PACKAGE_NAME)
62+ string (CONCAT FIREBASE_SPM_PACKAGES ${FIREBASE_SPM_PACKAGES}
63+ "\r\n ${INDENT} <swiftPackage name=\" ${PACKAGE_NAME} \" " )
64+
65+ list (LENGTH DEP_LIST SPM_DEP_LENGTH)
66+ if (${SPM_DEP_LENGTH} GREATER 1)
67+ list (GET DEP_LIST 1 PACKAGE_POD_IGNORE)
68+ string (CONCAT FIREBASE_SPM_PACKAGES ${FIREBASE_SPM_PACKAGES} " replacesPod=\" ${PACKAGE_POD_IGNORE} \" " )
69+ endif ()
70+
71+ string (CONCAT FIREBASE_SPM_PACKAGES ${FIREBASE_SPM_PACKAGES} "/>" )
72+
73+ endforeach (SPM_DEP )
74+ endif ()
75+
5776 foreach (IOS_DEP ${GEN_DEPS_IOS_DEPS} )
5877 string (REPLACE "," ";" DEP_LIST ${IOS_DEP} )
5978 list (GET DEP_LIST 0 DEP_NAME)
@@ -105,11 +124,15 @@ endfunction()
105124# that variables can be adjusted without affecting the build.
106125function (test_generate_xml )
107126
127+ set (FIREBASE_SPM_VERSION "1.2.3" )
108128 set (FIREBASE_IOS_POD_VERSION "1.2.3" )
109129 set (FIREBASE_UNITY_SDK_VERSION "4.5.6" )
110130 set (DEFAULT_MIN_TARGET_SDK "7.8" )
111131
112132 generate_dependencies_xml (Test
133+ FIREBASE_SPM_DEPS
134+ "TestPackage|TestPod,PinnedTestPod"
135+ "OtherPackage"
113136 IOS_DEPS
114137 "TestPod"
115138 "PinnedTestPod,7.8.9,1.0"
0 commit comments