Skip to content

Commit 04ca2c2

Browse files
authored
Merge pull request #40 from firebase/am-build-issues
Add more CMake options, and make the workflow handle passing options
2 parents e0cc9d4 + 962aae1 commit 04ca2c2

File tree

5 files changed

+35
-17
lines changed

5 files changed

+35
-17
lines changed

.github/workflows/sdk_build.yml

+7-2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ on:
1414
description: 'Linux Unity version'
1515
default: '2017.4.10f1'
1616
required: true
17+
# Additional CMake flags to use
18+
additional_cmake_flags:
19+
description: 'Additional flags to pass into CMake'
20+
default: ''
21+
required: false
1722

1823
jobs:
1924
build_desktop:
@@ -103,13 +108,13 @@ jobs:
103108
if: startsWith(matrix.os, 'ubuntu')
104109
shell: bash
105110
run: |
106-
./build_linux.sh
111+
./build_linux.sh ${{ github.event.inputs.additional_cmake_flags }}
107112
108113
- name: Build SDK (MacOS)
109114
if: startsWith(matrix.os, 'macos')
110115
shell: bash
111116
run: |
112-
./build_macos.sh
117+
./build_macos.sh ${{ github.event.inputs.additional_cmake_flags }}
113118
114119
- name: Build SDK (Windows)
115120
if: startsWith(matrix.os, 'windows')

CMakeLists.txt

+25-12
Original file line numberDiff line numberDiff line change
@@ -30,31 +30,44 @@ option(FIREBASE_UNI_LIBRARY "Link all firebase libraries into one shared object"
3030

3131
# Different options to enable/disable each library being included during
3232
# configuration.
33+
option(FIREBASE_INCLUDE_LIBRARY_DEFAULT
34+
"Should each library be included by default." ON)
3335
option(FIREBASE_INCLUDE_ANALYTICS
34-
"Include the Google Analytics for Firebase library." ON)
36+
"Include the Google Analytics for Firebase library."
37+
${FIREBASE_INCLUDE_LIBRARY_DEFAULT})
3538
option(FIREBASE_INCLUDE_AUTH
36-
"Include the Firebase Authentication library." ON)
39+
"Include the Firebase Authentication library."
40+
${FIREBASE_INCLUDE_LIBRARY_DEFAULT})
3741
option(FIREBASE_INCLUDE_CRASHLYTICS
38-
"Include the Firebase Crashlytics library." ON)
42+
"Include the Firebase Crashlytics library."
43+
${FIREBASE_INCLUDE_LIBRARY_DEFAULT})
3944
option(FIREBASE_INCLUDE_DATABASE
40-
"Include the Firebase Realtime Database library." ON)
45+
"Include the Firebase Realtime Database library."
46+
${FIREBASE_INCLUDE_LIBRARY_DEFAULT})
4147
option(FIREBASE_INCLUDE_DYNAMIC_LINKS
42-
"Include the Firebase Dynamic Links library." ON)
48+
"Include the Firebase Dynamic Links library."
49+
${FIREBASE_INCLUDE_LIBRARY_DEFAULT})
4350
option(FIREBASE_INCLUDE_INSTALLATIONS
44-
"Include the Firebase Installations library." ON)
51+
"Include the Firebase Installations library."
52+
${FIREBASE_INCLUDE_LIBRARY_DEFAULT})
4553
option(FIREBASE_INCLUDE_FIRESTORE
46-
"Include the Firebase Firestore library." ON)
54+
"Include the Firebase Firestore library."
55+
${FIREBASE_INCLUDE_LIBRARY_DEFAULT})
4756
option(FIREBASE_INCLUDE_FUNCTIONS
48-
"Include the Cloud Functions for Firebase library." ON)
57+
"Include the Cloud Functions for Firebase library."
58+
${FIREBASE_INCLUDE_LIBRARY_DEFAULT})
4959
option(FIREBASE_INCLUDE_MESSAGING
50-
"Include the Firebase Cloud Messaging library." ON)
60+
"Include the Firebase Cloud Messaging library."
61+
${FIREBASE_INCLUDE_LIBRARY_DEFAULT})
5162
option(FIREBASE_INCLUDE_REMOTE_CONFIG
52-
"Include the Firebase Remote Config library." ON)
63+
"Include the Firebase Remote Config library."
64+
${FIREBASE_INCLUDE_LIBRARY_DEFAULT})
5365
option(FIREBASE_INCLUDE_STORAGE
54-
"Include the Cloud Storage for Firebase library." ON)
66+
"Include the Cloud Storage for Firebase library."
67+
${FIREBASE_INCLUDE_LIBRARY_DEFAULT})
5568

5669
option(FIREBASE_INCLUDE_EDITOR_TOOL
57-
"Include Unity editor tools for Firebase library." ON)
70+
"Include Unity editor tools for Firebase library." OFF)
5871
option(FIREBASE_UNITY_BUILD_TESTS
5972
"Enable the Firebase Unity Build Tests." OFF)
6073

build_bash.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ for option in "${build_options[@]}" ; do
6767
pushd "$DIR"
6868

6969
# Configure cmake with option value
70-
cmake .. ${CMAKE_OPTIONS} ${EXTRA_OPTIONS}
70+
cmake .. ${CMAKE_OPTIONS} ${EXTRA_OPTIONS} "$@"
7171
check_exit_code $?
7272

7373
# Build the SDK

build_linux.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ set -e
2222
set -x
2323

2424
export PLATFORM=linux
25-
./build_bash.sh
25+
./build_bash.sh "$@"

build_macos.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ set -e
2525
set -x
2626

2727
export PLATFORM=macos
28-
./build_bash.sh
28+
./build_bash.sh "$@"

0 commit comments

Comments
 (0)