Skip to content

Commit 4ba9d36

Browse files
authored
Merge pull request #166 from firebase/feature/js-packaging2
Continue work on packaging: Android and iOS done, Linux done, Mac done, Windows done (though still need /MD and /MT build pair).
2 parents e604ac7 + a4ad766 commit 4ba9d36

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+3967
-142
lines changed

.github/workflows/cpp-packaging.yml

Lines changed: 391 additions & 41 deletions
Large diffs are not rendered by default.

CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,14 @@ option(FIREBASE_CPP_BUILD_PACKAGE
6767
option(FIREBASE_CPP_USE_PRIOR_GRADLE_BUILD
6868
"When building with Gradle, use the previously built libraries." OFF)
6969

70+
set(FIREBASE_ANDROID_STL "" CACHE STRING "STL implementation to use.")
71+
if (NOT FIREBASE_ANDROID_STL STREQUAL "")
72+
set(ANDROID_STL ${FIREBASE_ANDROID_STL})
73+
endif()
74+
75+
set(FIREBASE_XCODE_TARGET_FORMAT "frameworks" CACHE STRING
76+
"Format to output, 'frameworks' or 'libraries'")
77+
7078
# Define this directory to be the root of the C++ SDK, which the libraries can
7179
# then refer to.
7280
set(FIREBASE_CPP_SDK_ROOT_DIR ${CMAKE_CURRENT_LIST_DIR})

admob/CMakeLists.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,11 @@ elseif(IOS)
120120
# accomplish that.
121121
symlink_pod_headers(firebase_admob Google-Mobile-Ads-SDK GoogleMobileAds)
122122

123-
set_target_properties(firebase_admob PROPERTIES
124-
FRAMEWORK TRUE
125-
)
123+
if (FIREBASE_XCODE_TARGET_FORMAT STREQUAL "frameworks")
124+
set_target_properties(firebase_admob PROPERTIES
125+
FRAMEWORK TRUE
126+
)
127+
endif()
126128
endif()
127129

128130
cpp_pack_library(firebase_admob "")

admob/build.gradle

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ allprojects {
3030

3131
apply plugin: 'com.android.library'
3232

33+
ext {
34+
firebaseAndroidStl = System.getenv('FIREBASE_ANDROID_STL')
35+
firebaseAndroidStl = firebaseAndroidStl != null ? firebaseAndroidStl : ''
36+
}
37+
3338
android {
3439
compileSdkVersion 28
3540
buildToolsVersion '28.0.3'
@@ -67,8 +72,9 @@ android {
6772
// Only include needed project.
6873
arguments '-DFIREBASE_CPP_USE_PRIOR_GRADLE_BUILD=ON',
6974
'-DFIREBASE_INCLUDE_LIBRARY_DEFAULT=OFF',
70-
'-DFIREBASE_INCLUDE_ADMOB=ON'
71-
}
75+
'-DFIREBASE_INCLUDE_ADMOB=ON',
76+
"-DFIREBASE_ANDROID_STL=${firebaseAndroidStl}"
77+
}
7278
}
7379
}
7480

@@ -85,4 +91,4 @@ apply from: "$rootDir/android_build_files/generate_proguard.gradle"
8591
project.afterEvaluate {
8692
generateProguardFile('admob')
8793
setupDexDependencies(':admob:admob_resources')
88-
}
94+
}

analytics/CMakeLists.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,11 @@ elseif(IOS)
128128
FirebaseAnalytics
129129
)
130130

131-
set_target_properties(firebase_analytics PROPERTIES
132-
FRAMEWORK TRUE
133-
)
131+
if (FIREBASE_XCODE_TARGET_FORMAT STREQUAL "frameworks")
132+
set_target_properties(firebase_analytics PROPERTIES
133+
FRAMEWORK TRUE
134+
)
135+
endif()
134136
endif()
135137

136138
if(FIREBASE_CPP_BUILD_TESTS)

analytics/build.gradle

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ allprojects {
3030

3131
apply plugin: 'com.android.library'
3232

33+
ext {
34+
firebaseAndroidStl = System.getenv('FIREBASE_ANDROID_STL')
35+
firebaseAndroidStl = firebaseAndroidStl != null ? firebaseAndroidStl : ''
36+
}
37+
3338
android {
3439
compileSdkVersion 28
3540
buildToolsVersion '28.0.3'
@@ -67,7 +72,8 @@ android {
6772
// Only include needed project.
6873
arguments '-DFIREBASE_CPP_USE_PRIOR_GRADLE_BUILD=ON',
6974
'-DFIREBASE_INCLUDE_LIBRARY_DEFAULT=OFF',
70-
'-DFIREBASE_INCLUDE_ANALYTICS=ON'
75+
'-DFIREBASE_INCLUDE_ANALYTICS=ON',
76+
"-DFIREBASE_ANDROID_STL=${firebaseAndroidStl}"
7177
}
7278
}
7379
}
@@ -84,4 +90,4 @@ apply from: "$rootDir/android_build_files/extract_and_dex.gradle"
8490
apply from: "$rootDir/android_build_files/generate_proguard.gradle"
8591
project.afterEvaluate {
8692
generateProguardFile('analytics')
87-
}
93+
}

app/CMakeLists.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -377,9 +377,11 @@ endif()
377377

378378
if (IOS)
379379
# IOS build framework
380-
set_target_properties(firebase_app PROPERTIES
381-
FRAMEWORK TRUE
382-
)
380+
if (FIREBASE_XCODE_TARGET_FORMAT STREQUAL "frameworks")
381+
set_target_properties(firebase_app PROPERTIES
382+
FRAMEWORK TRUE
383+
)
384+
endif()
383385

384386
# framework header files
385387
set(admob_HDRS

app/build.gradle

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ allprojects {
3030

3131
apply plugin: 'com.android.library'
3232

33+
ext {
34+
firebaseAndroidStl = System.getenv('FIREBASE_ANDROID_STL')
35+
firebaseAndroidStl = firebaseAndroidStl != null ? firebaseAndroidStl : ''
36+
}
37+
3338
android {
3439
compileSdkVersion 28
3540
buildToolsVersion '28.0.3'
@@ -63,7 +68,8 @@ android {
6368
cmake {
6469
targets 'firebase_app'
6570
// Don't configure all the cmake subprojects.
66-
arguments '-DFIREBASE_INCLUDE_LIBRARY_DEFAULT=OFF'
71+
arguments '-DFIREBASE_INCLUDE_LIBRARY_DEFAULT=OFF',
72+
"-DFIREBASE_ANDROID_STL=${firebaseAndroidStl}"
6773
}
6874
}
6975
}
@@ -80,4 +86,4 @@ project.afterEvaluate {
8086
setupDexDependencies(':app:app_resources')
8187
setupDexDependencies(':app:google_api_resources')
8288
setupDexDependencies(':app:invites_resources')
83-
}
89+
}

auth/CMakeLists.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,11 @@ elseif(IOS)
200200
FirebaseCore
201201
FirebaseAuth
202202
)
203-
set_target_properties(firebase_auth PROPERTIES
204-
FRAMEWORK TRUE
205-
)
203+
if (FIREBASE_XCODE_TARGET_FORMAT STREQUAL "frameworks")
204+
set_target_properties(firebase_auth PROPERTIES
205+
FRAMEWORK TRUE
206+
)
207+
endif()
206208
endif()
207209

208210
if(FIREBASE_CPP_BUILD_TESTS)

auth/build.gradle

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ allprojects {
3030

3131
apply plugin: 'com.android.library'
3232

33+
ext {
34+
firebaseAndroidStl = System.getenv('FIREBASE_ANDROID_STL')
35+
firebaseAndroidStl = firebaseAndroidStl != null ? firebaseAndroidStl : ''
36+
}
37+
3338
android {
3439
compileSdkVersion 28
3540
buildToolsVersion '28.0.3'
@@ -67,7 +72,8 @@ android {
6772
// Only include needed project.
6873
arguments '-DFIREBASE_CPP_USE_PRIOR_GRADLE_BUILD=ON',
6974
'-DFIREBASE_INCLUDE_LIBRARY_DEFAULT=OFF',
70-
'-DFIREBASE_INCLUDE_AUTH=ON'
75+
'-DFIREBASE_INCLUDE_AUTH=ON',
76+
"-DFIREBASE_ANDROID_STL=${firebaseAndroidStl}"
7177
}
7278
}
7379
}
@@ -85,4 +91,4 @@ apply from: "$rootDir/android_build_files/generate_proguard.gradle"
8591
project.afterEvaluate {
8692
generateProguardFile('auth')
8793
setupDexDependencies(':auth:auth_resources')
88-
}
94+
}

0 commit comments

Comments
 (0)