From 5609209f20eaaff03db656d70dc2e253361b96c0 Mon Sep 17 00:00:00 2001 From: Vimanyu Date: Wed, 25 Nov 2020 10:07:21 -0800 Subject: [PATCH 01/23] manual dispatch workflow to run examples --- .github/workflows/desktop.yml | 112 ++++++++++++++++++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100644 .github/workflows/desktop.yml diff --git a/.github/workflows/desktop.yml b/.github/workflows/desktop.yml new file mode 100644 index 00000000..070b2986 --- /dev/null +++ b/.github/workflows/desktop.yml @@ -0,0 +1,112 @@ +name: Desktop build + +on: + workflow_dispatch: + inputs: + downloadPublicVersion: + description: 'public version # to test against' + apis: + description: 'CSV of apis whose quickstart examples we should build' + default: 'admob,analytics,auth,database,dynamic_links,firestore,functions,messaging,remote_config,storage' + required: true + +jobs: + build: + name: ${{ matrix.os }}-${{ matrix.build_type }}-${{ matrix.architecture }}-${{ matrix.msvc_runtime}} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [windows-latest, ubuntu-latest, macos-latest] + build_type: ["Release", "Debug"] + architecture: ["x64", "x86"] + msvc_runtime: ["static", "dynamic"] + python_version: [3.7] + + include: + - os: windows-latest + vcpkg_triplet_suffix: "windows-static" + - os: windows-latest + msvc_runtime: "dynamic" + vcpkg_triplet_suffix: "windows-static-md" + - os: ubuntu-latest + vcpkg_triplet_suffix: "linux" + - os: macos-latest + vcpkg_triplet_suffix: "osx" + + exclude: + - os: macos-latest + architecture: "x86" + - os: macos-latest + msvc_runtime: "dynamic" + - os: ubuntu-latest + msvc_runtime: "dynamic" + + steps: + - uses: actions/checkout@v2 + with: + submodules: true + + - uses: actions/checkout@v2 + with: + repository: 'firebase/firebase-cpp-sdk' + branch: 'feature/python-tools-build-apps-with-firebase' + submodules: true + path: 'firebase-cpp-sdk-source' + + - name: log run inputs + run: | + if [[ -n "${{ github.event.inputs.downloadPublicVersion }}" ]]; then + echo "::warning ::Downloading public SDK package from https://dl.google.com/firebase/sdk/cpp/firebase_cpp_sdk_${{ github.event.inputs.downloadPublicVersion }}.zip" + if [[ -n "${{ github.event.inputs.apis}}" ]]; then + echo "::warning ::Building and running quickstarts for ${{ github.event.inputs.apis}}" + + - name: download public SDK package from web + if: ${{ github.event.inputs.downloadPublicVersion != '' }} + run: | + if [[ ! "${{ github.event.inputs.downloadPublicVersion }}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + echo Invalid version number: "${{ github.event.inputs.downloadPublicVersion }}" + exit 1 + fi + set +e + # Retry up to 10 times because Curl has a tendency to timeout on + # Github runners. + for retry in {1..10} error; do + if [[ $retry == "error" ]]; then exit 5; fi + curl -L https://dl.google.com/firebase/sdk/cpp/firebase_cpp_sdk_${{ github.event.inputs.downloadPublicVersion }}.zip --output firebase_cpp_sdk.zip && break + sleep 300 + done + set -e + + - name: Unzip Firebase C++ SDK + shell: bash + if: ${{ github.event.inputs.downloadPublicVersion != '' }} + run: | + ls + if [ "$RUNNER_OS" == "Windows" ]; then + 7z x firebase_cpp_sdk.zip + else + unzip -q firebase_cpp_sdk.zip + fi + + - name: Setup python + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python_version }} + architecture: 'x64' + + - name: Build apps + shell: bash + run: | + python firebase-cpp-sdk-source/scripts/build_desktop_app_with_firebase.py --sdk_dir firebase-cpp-sdk-source --app_dir messaging/testapp --build_dir build + + - name: Print built libraries + shell: bash + run: | + find build -name "*.lib" + find build -name "*.dll" + find build -name "*.dylib" + find build -name "*.a" + find build -name "*.so" + find build -name "*.framework" + ls build/ \ No newline at end of file From 3a6a50a96256da601b8279855a34d05141f8c601 Mon Sep 17 00:00:00 2001 From: Vimanyu Date: Wed, 25 Nov 2020 10:11:44 -0800 Subject: [PATCH 02/23] temp: trigger on push --- .github/workflows/desktop.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/desktop.yml b/.github/workflows/desktop.yml index 070b2986..48927a5a 100644 --- a/.github/workflows/desktop.yml +++ b/.github/workflows/desktop.yml @@ -1,6 +1,8 @@ name: Desktop build on: + push: + workflow_dispatch: inputs: downloadPublicVersion: From 149b84a2b33c06274e9fdc1fc7bfd50fc5b9d691 Mon Sep 17 00:00:00 2001 From: Vimanyu Date: Wed, 25 Nov 2020 10:14:41 -0800 Subject: [PATCH 03/23] removing log step --- .github/workflows/desktop.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/workflows/desktop.yml b/.github/workflows/desktop.yml index 48927a5a..9d022f75 100644 --- a/.github/workflows/desktop.yml +++ b/.github/workflows/desktop.yml @@ -56,13 +56,6 @@ jobs: submodules: true path: 'firebase-cpp-sdk-source' - - name: log run inputs - run: | - if [[ -n "${{ github.event.inputs.downloadPublicVersion }}" ]]; then - echo "::warning ::Downloading public SDK package from https://dl.google.com/firebase/sdk/cpp/firebase_cpp_sdk_${{ github.event.inputs.downloadPublicVersion }}.zip" - if [[ -n "${{ github.event.inputs.apis}}" ]]; then - echo "::warning ::Building and running quickstarts for ${{ github.event.inputs.apis}}" - - name: download public SDK package from web if: ${{ github.event.inputs.downloadPublicVersion != '' }} run: | From 7516fcfe02a28b948e0431bd4b6513b1df4d0529 Mon Sep 17 00:00:00 2001 From: Vimanyu Date: Wed, 25 Nov 2020 10:15:42 -0800 Subject: [PATCH 04/23] checkout action uses ref not branch --- .github/workflows/desktop.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/desktop.yml b/.github/workflows/desktop.yml index 9d022f75..1eda24d5 100644 --- a/.github/workflows/desktop.yml +++ b/.github/workflows/desktop.yml @@ -52,7 +52,7 @@ jobs: - uses: actions/checkout@v2 with: repository: 'firebase/firebase-cpp-sdk' - branch: 'feature/python-tools-build-apps-with-firebase' + ref : 'feature/python-tools-build-apps-with-firebase' submodules: true path: 'firebase-cpp-sdk-source' From c759a79bd0eadcff3ace0047ed411dc6ec64c6d6 Mon Sep 17 00:00:00 2001 From: Vimanyu Date: Wed, 25 Nov 2020 10:21:21 -0800 Subject: [PATCH 05/23] fixed branch name --- .github/workflows/desktop.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/desktop.yml b/.github/workflows/desktop.yml index 1eda24d5..f2354d4a 100644 --- a/.github/workflows/desktop.yml +++ b/.github/workflows/desktop.yml @@ -52,7 +52,7 @@ jobs: - uses: actions/checkout@v2 with: repository: 'firebase/firebase-cpp-sdk' - ref : 'feature/python-tools-build-apps-with-firebase' + ref : 'feature/python-tool-build-apps-with-firebase' submodules: true path: 'firebase-cpp-sdk-source' From 14471e35c688975aacab9a5e874233ad6811fb19 Mon Sep 17 00:00:00 2001 From: Vimanyu Date: Wed, 25 Nov 2020 10:26:40 -0800 Subject: [PATCH 06/23] checkout repo with all history and branches --- .github/workflows/desktop.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/desktop.yml b/.github/workflows/desktop.yml index f2354d4a..477ff0de 100644 --- a/.github/workflows/desktop.yml +++ b/.github/workflows/desktop.yml @@ -54,6 +54,7 @@ jobs: repository: 'firebase/firebase-cpp-sdk' ref : 'feature/python-tool-build-apps-with-firebase' submodules: true + fetch-depth: 0 path: 'firebase-cpp-sdk-source' - name: download public SDK package from web From 036f4e1e8ffd2adbe0b85ff6d2126c62822be4a4 Mon Sep 17 00:00:00 2001 From: Vimanyu Date: Wed, 25 Nov 2020 10:42:39 -0800 Subject: [PATCH 07/23] using the right build dir for info --- .github/workflows/desktop.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/desktop.yml b/.github/workflows/desktop.yml index 477ff0de..8c960a4d 100644 --- a/.github/workflows/desktop.yml +++ b/.github/workflows/desktop.yml @@ -99,10 +99,10 @@ jobs: - name: Print built libraries shell: bash run: | - find build -name "*.lib" - find build -name "*.dll" - find build -name "*.dylib" - find build -name "*.a" - find build -name "*.so" - find build -name "*.framework" - ls build/ \ No newline at end of file + find messaging/testapp/build -name "*.lib" + find messaging/testapp/build -name "*.dll" + find messaging/testapp/build -name "*.dylib" + find messaging/testapp/build -name "*.a" + find messaging/testapp/build -name "*.so" + find messaging/testapp/build -name "*.framework" + ls messaging/testapp/build/ \ No newline at end of file From 32fcdbfe7171993f8956ba0ee4a07b6d09c6560f Mon Sep 17 00:00:00 2001 From: Vimanyu Date: Wed, 25 Nov 2020 10:51:01 -0800 Subject: [PATCH 08/23] loop over all firebase apis --- .github/workflows/desktop.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/desktop.yml b/.github/workflows/desktop.yml index 8c960a4d..6369ca2d 100644 --- a/.github/workflows/desktop.yml +++ b/.github/workflows/desktop.yml @@ -93,8 +93,20 @@ jobs: - name: Build apps shell: bash + env: + APIS: ${{ github.event.inputs.apis}} run: | - python firebase-cpp-sdk-source/scripts/build_desktop_app_with_firebase.py --sdk_dir firebase-cpp-sdk-source --app_dir messaging/testapp --build_dir build + OLDIFS=$IFS + IFS=',' + set -f + apilist = ${{ github.event.inputs.apis}} + for api in apilist; do + set +f + echo "$api" + python firebase-cpp-sdk-source/scripts/build_desktop_app_with_firebase.py --sdk_dir firebase-cpp-sdk-source --app_dir $api/testapp --build_dir build + done + set +f + IFS=$OLDIFS - name: Print built libraries shell: bash From 891eca7546c9e000a3d8a0b0bb5e003282867f18 Mon Sep 17 00:00:00 2001 From: Vimanyu Date: Wed, 25 Nov 2020 10:54:15 -0800 Subject: [PATCH 09/23] using 2 apis for testing --- .github/workflows/desktop.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/desktop.yml b/.github/workflows/desktop.yml index 6369ca2d..0b17f01b 100644 --- a/.github/workflows/desktop.yml +++ b/.github/workflows/desktop.yml @@ -99,8 +99,8 @@ jobs: OLDIFS=$IFS IFS=',' set -f - apilist = ${{ github.event.inputs.apis}} - for api in apilist; do + apilist = "auth,messaging" + for api in $apilist; do set +f echo "$api" python firebase-cpp-sdk-source/scripts/build_desktop_app_with_firebase.py --sdk_dir firebase-cpp-sdk-source --app_dir $api/testapp --build_dir build From 0308c18f05490a8ae2175436ca3647b840152bb5 Mon Sep 17 00:00:00 2001 From: Vimanyu Date: Wed, 25 Nov 2020 10:55:59 -0800 Subject: [PATCH 10/23] using dev branch --- .github/workflows/desktop.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/desktop.yml b/.github/workflows/desktop.yml index 0b17f01b..6d341ddb 100644 --- a/.github/workflows/desktop.yml +++ b/.github/workflows/desktop.yml @@ -52,9 +52,8 @@ jobs: - uses: actions/checkout@v2 with: repository: 'firebase/firebase-cpp-sdk' - ref : 'feature/python-tool-build-apps-with-firebase' + ref : 'dev' submodules: true - fetch-depth: 0 path: 'firebase-cpp-sdk-source' - name: download public SDK package from web From aba3091f3e01a406ad6a82f80b8f4092868f9074 Mon Sep 17 00:00:00 2001 From: Vimanyu Date: Wed, 25 Nov 2020 10:57:51 -0800 Subject: [PATCH 11/23] removing space around assignment --- .github/workflows/desktop.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/desktop.yml b/.github/workflows/desktop.yml index 6d341ddb..69578f00 100644 --- a/.github/workflows/desktop.yml +++ b/.github/workflows/desktop.yml @@ -98,7 +98,7 @@ jobs: OLDIFS=$IFS IFS=',' set -f - apilist = "auth,messaging" + apilist="auth,messaging" for api in $apilist; do set +f echo "$api" From f2661d2cc58774824b2cf4bfa3650e928a627a6e Mon Sep 17 00:00:00 2001 From: Vimanyu Date: Wed, 25 Nov 2020 13:52:09 -0800 Subject: [PATCH 12/23] support md/mt properly on windows Using a top level CMake option to drive /mt vs /md. --- .github/workflows/desktop.yml | 2 +- auth/testapp/CMakeLists.txt | 50 ++++++++++++++++++++++++++----- messaging/testapp/CMakeLists.txt | 51 +++++++++++++++++++++++++++----- 3 files changed, 86 insertions(+), 17 deletions(-) diff --git a/.github/workflows/desktop.yml b/.github/workflows/desktop.yml index 69578f00..b5945aa7 100644 --- a/.github/workflows/desktop.yml +++ b/.github/workflows/desktop.yml @@ -102,7 +102,7 @@ jobs: for api in $apilist; do set +f echo "$api" - python firebase-cpp-sdk-source/scripts/build_desktop_app_with_firebase.py --sdk_dir firebase-cpp-sdk-source --app_dir $api/testapp --build_dir build + python firebase-cpp-sdk-source/scripts/build_desktop_app_with_firebase.py --sdk_dir firebase-cpp-sdk-source --app_dir $api/testapp --build_dir build --msvc_runtime_library ${{ matrix.msvc_runtime }} done set +f IFS=$OLDIFS diff --git a/auth/testapp/CMakeLists.txt b/auth/testapp/CMakeLists.txt index f5aa704f..a3fe07fa 100644 --- a/auth/testapp/CMakeLists.txt +++ b/auth/testapp/CMakeLists.txt @@ -15,10 +15,27 @@ if(NOT EXISTS ${FIREBASE_CPP_SDK_DIR}) message(FATAL_ERROR "The Firebase C++ SDK directory does not exist: ${FIREBASE_CPP_SDK_DIR}. See the readme.md for more information") endif() -# Windows runtime mode, either MD or MT depending on whether you are using -# /MD or /MT. For more information see: -# https://msdn.microsoft.com/en-us/library/2kzt1wy3.aspx -set(MSVC_RUNTIME_MODE MD) +if (MSVC) + if (MSVC_RUNTIME_LIBRARY_STATIC) + add_compile_options( + $<$:/MT> + $<$:/MTd> + $<$:/MT> + ) + # Ideally we should be setting this variable as per the Debug/Release config + # (MT vs MTd) but our prebuilt libraries don't ship with Debug builds. + set(MSVC_RUNTIME_MODE MT) + else() + add_compile_options( + $<$:/MD> + $<$:/MDd> + $<$:/MD> + ) + # Ideally we should be setting this variable as per the Debug/Release config + # (MDd vs MD)but our prebuilt libraries don't ship with Debug builds. + set(MSVC_RUNTIME_MODE MD) + endif() +endif() project(firebase_testapp) @@ -69,10 +86,27 @@ if(ANDROID) else() # Build a desktop application. - # Windows runtime mode, either MD or MT depending on whether you are using - # /MD or /MT. For more information see: - # https://msdn.microsoft.com/en-us/library/2kzt1wy3.aspx - set(MSVC_RUNTIME_MODE MD) + if (MSVC) + if (MSVC_RUNTIME_LIBRARY_STATIC) + add_compile_options( + $<$:/MT> + $<$:/MTd> + $<$:/MT> + ) + # Ideally we should be setting this variable as per the Debug/Release config + # (MT vs MTd) but our prebuilt libraries don't ship with Debug builds. + set(MSVC_RUNTIME_MODE MT) + else() + add_compile_options( + $<$:/MD> + $<$:/MDd> + $<$:/MD> + ) + # Ideally we should be setting this variable as per the Debug/Release config + # (MDd vs MD)but our prebuilt libraries don't ship with Debug builds. + set(MSVC_RUNTIME_MODE MD) + endif() + endif() # Platform abstraction layer for the desktop sample. set(FIREBASE_SAMPLE_DESKTOP_SRCS diff --git a/messaging/testapp/CMakeLists.txt b/messaging/testapp/CMakeLists.txt index 03bd733e..396606c1 100644 --- a/messaging/testapp/CMakeLists.txt +++ b/messaging/testapp/CMakeLists.txt @@ -15,10 +15,27 @@ if(NOT EXISTS ${FIREBASE_CPP_SDK_DIR}) message(FATAL_ERROR "The Firebase C++ SDK directory does not exist: ${FIREBASE_CPP_SDK_DIR}. See the readme.md for more information") endif() -# Windows runtime mode, either MD or MT depending on whether you are using -# /MD or /MT. For more information see: -# https://msdn.microsoft.com/en-us/library/2kzt1wy3.aspx -set(MSVC_RUNTIME_MODE MD) +if (MSVC) + if (MSVC_RUNTIME_LIBRARY_STATIC) + add_compile_options( + $<$:/MT> + $<$:/MTd> + $<$:/MT> + ) + # Ideally we should be setting this variable as per the Debug/Release config + # (MT vs MTd) but our prebuilt libraries don't ship with Debug builds. + set(MSVC_RUNTIME_MODE MT) + else() + add_compile_options( + $<$:/MD> + $<$:/MDd> + $<$:/MD> + ) + # Ideally we should be setting this variable as per the Debug/Release config + # (MDd vs MD)but our prebuilt libraries don't ship with Debug builds. + set(MSVC_RUNTIME_MODE MD) + endif() +endif() project(firebase_testapp) @@ -69,10 +86,28 @@ if(ANDROID) else() # Build a desktop application. - # Windows runtime mode, either MD or MT depending on whether you are using - # /MD or /MT. For more information see: - # https://msdn.microsoft.com/en-us/library/2kzt1wy3.aspx - set(MSVC_RUNTIME_MODE MD) + if (MSVC) + if (MSVC_RUNTIME_LIBRARY_STATIC) + add_compile_options( + $<$:/MT> + $<$:/MTd> + $<$:/MT> + ) + # Ideally we should be setting this variable as per the Debug/Release config + # (MT vs MTd) but our prebuilt libraries don't ship with Debug builds. + set(MSVC_RUNTIME_MODE MT) + else() + add_compile_options( + $<$:/MD> + $<$:/MDd> + $<$:/MD> + ) + # Ideally we should be setting this variable as per the Debug/Release config + # (MDd vs MD)but our prebuilt libraries don't ship with Debug builds. + set(MSVC_RUNTIME_MODE MD) + endif() + endif() + # Platform abstraction layer for the desktop sample. set(FIREBASE_SAMPLE_DESKTOP_SRCS From f5a7bb6665f6027c3df14b45bf5b4f8a1fbd87af Mon Sep 17 00:00:00 2001 From: Vimanyu Date: Wed, 25 Nov 2020 14:28:55 -0800 Subject: [PATCH 13/23] support build with prebuilt firebase libraries Also changed workflow name to match the one in firebase-cpp-sdk --- .github/workflows/desktop.yml | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/.github/workflows/desktop.yml b/.github/workflows/desktop.yml index b5945aa7..1a656600 100644 --- a/.github/workflows/desktop.yml +++ b/.github/workflows/desktop.yml @@ -1,4 +1,4 @@ -name: Desktop build +name: Desktop builds on: push: @@ -90,15 +90,16 @@ jobs: python-version: ${{ matrix.python_version }} architecture: 'x64' - - name: Build apps + - name: Build apps against Firebase C++ source shell: bash + if: ${{ github.event.inputs.downloadPublicVersion == '' }} env: APIS: ${{ github.event.inputs.apis}} run: | OLDIFS=$IFS IFS=',' set -f - apilist="auth,messaging" + apilist="${APIS:-'auth,messaging'}" for api in $apilist; do set +f echo "$api" @@ -107,6 +108,25 @@ jobs: set +f IFS=$OLDIFS + - name: Build apps against Firebase C++ prebuilt libraries + shell: bash + if: ${{ github.event.inputs.downloadPublicVersion != '' }} + env: + APIS: ${{ github.event.inputs.apis}} + run: | + OLDIFS=$IFS + IFS=',' + set -f + apilist="${APIS:-'auth,messaging'}" + for api in $apilist; do + set +f + echo "$api" + python firebase-cpp-sdk-source/scripts/build_desktop_app_with_firebase.py --sdk_dir firebase-cpp-sdk --app_dir $api/testapp --build_dir build --msvc_runtime_library ${{ matrix.msvc_runtime }} + done + set +f + IFS=$OLDIFS + + - name: Print built libraries shell: bash run: | From c96edec3736ce5b6dd6165334d988503ff3f31e2 Mon Sep 17 00:00:00 2001 From: Vimanyu Date: Wed, 25 Nov 2020 14:33:56 -0800 Subject: [PATCH 14/23] removing single quotes around api list --- .github/workflows/desktop.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/desktop.yml b/.github/workflows/desktop.yml index 1a656600..c648238e 100644 --- a/.github/workflows/desktop.yml +++ b/.github/workflows/desktop.yml @@ -99,7 +99,7 @@ jobs: OLDIFS=$IFS IFS=',' set -f - apilist="${APIS:-'auth,messaging'}" + apilist="${APIS:-auth,messaging}" for api in $apilist; do set +f echo "$api" @@ -117,7 +117,7 @@ jobs: OLDIFS=$IFS IFS=',' set -f - apilist="${APIS:-'auth,messaging'}" + apilist="${APIS:-auth,messaging}" for api in $apilist; do set +f echo "$api" From 9ce3a1dbb6a68a2cb92772541874a1459ca50699 Mon Sep 17 00:00:00 2001 From: Vimanyu Date: Wed, 25 Nov 2020 14:36:06 -0800 Subject: [PATCH 15/23] fixed extracted directory name --- .github/workflows/desktop.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/desktop.yml b/.github/workflows/desktop.yml index c648238e..272f37bc 100644 --- a/.github/workflows/desktop.yml +++ b/.github/workflows/desktop.yml @@ -121,7 +121,7 @@ jobs: for api in $apilist; do set +f echo "$api" - python firebase-cpp-sdk-source/scripts/build_desktop_app_with_firebase.py --sdk_dir firebase-cpp-sdk --app_dir $api/testapp --build_dir build --msvc_runtime_library ${{ matrix.msvc_runtime }} + python firebase-cpp-sdk-source/scripts/build_desktop_app_with_firebase.py --sdk_dir firebase_cpp_sdk --app_dir $api/testapp --build_dir build --msvc_runtime_library ${{ matrix.msvc_runtime }} done set +f IFS=$OLDIFS From 9c2963d1545a8cf6f2321b19fe2e50cc0642499f Mon Sep 17 00:00:00 2001 From: Vimanyu Date: Wed, 25 Nov 2020 14:45:10 -0800 Subject: [PATCH 16/23] force shell to bash even on windows --- .github/workflows/desktop.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/desktop.yml b/.github/workflows/desktop.yml index 272f37bc..2088c79c 100644 --- a/.github/workflows/desktop.yml +++ b/.github/workflows/desktop.yml @@ -58,6 +58,7 @@ jobs: - name: download public SDK package from web if: ${{ github.event.inputs.downloadPublicVersion != '' }} + shell: bash run: | if [[ ! "${{ github.event.inputs.downloadPublicVersion }}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then echo Invalid version number: "${{ github.event.inputs.downloadPublicVersion }}" From f6b824d869d29948e355ce95bd2d60ccb6ca4414 Mon Sep 17 00:00:00 2001 From: Vimanyu Date: Wed, 25 Nov 2020 14:55:23 -0800 Subject: [PATCH 17/23] generic verification steps Step to print built libraries and executables. Step to inspect built libraries for architecture and msvc runtime. --- .github/workflows/desktop.yml | 39 ++++++++++++++++++++++++++++------- 1 file changed, 31 insertions(+), 8 deletions(-) diff --git a/.github/workflows/desktop.yml b/.github/workflows/desktop.yml index 2088c79c..c453497b 100644 --- a/.github/workflows/desktop.yml +++ b/.github/workflows/desktop.yml @@ -127,14 +127,37 @@ jobs: set +f IFS=$OLDIFS - - name: Print built libraries shell: bash run: | - find messaging/testapp/build -name "*.lib" - find messaging/testapp/build -name "*.dll" - find messaging/testapp/build -name "*.dylib" - find messaging/testapp/build -name "*.a" - find messaging/testapp/build -name "*.so" - find messaging/testapp/build -name "*.framework" - ls messaging/testapp/build/ \ No newline at end of file + OLDIFS=$IFS + IFS=',' + set -f + apilist="${APIS:-auth,messaging}" + for api in $apilist; do + set +f + find $api/testapp/build -name "*.lib" + find $api/testapp/build -name "*.dll" + find $api/testapp/build -name "*.dylib" + find $api/testapp/build -name "*.a" + find $api/testapp/build -name "*.so" + find $api/testapp/build -name "*.framework" + ls $api/testapp/build/ + done + set +f + IFS=$OLDIFS + + - name: Inspect firebase libraries for cpu arch and msvc runtime. + shell: bash + run: | + OLDIFS=$IFS + IFS=',' + set -f + apilist="${APIS:-auth,messaging}" + for api in $apilist; do + set +f + python firebase-cpp-sdk-source/scripts/gha/inspect_built_libraries.py $api/testapp/build + done + set +f + IFS=$OLDIF + continue-on-error: true From d70519dfb6dd62ab2c0bffe7314ad46a868d67c9 Mon Sep 17 00:00:00 2001 From: Vimanyu Date: Wed, 25 Nov 2020 14:58:09 -0800 Subject: [PATCH 18/23] print final desktop_testapp executable path --- .github/workflows/desktop.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/desktop.yml b/.github/workflows/desktop.yml index c453497b..9fa4f39f 100644 --- a/.github/workflows/desktop.yml +++ b/.github/workflows/desktop.yml @@ -142,7 +142,7 @@ jobs: find $api/testapp/build -name "*.a" find $api/testapp/build -name "*.so" find $api/testapp/build -name "*.framework" - ls $api/testapp/build/ + find $api/testapp/build -name "desktop_testapp*" done set +f IFS=$OLDIFS From 908e4c96378da239b6f81952c7aeaf9d8fd3639c Mon Sep 17 00:00:00 2001 From: Vimanyu Date: Wed, 25 Nov 2020 15:02:41 -0800 Subject: [PATCH 19/23] setting env variables correctly --- .github/workflows/desktop.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/desktop.yml b/.github/workflows/desktop.yml index 9fa4f39f..507de6bf 100644 --- a/.github/workflows/desktop.yml +++ b/.github/workflows/desktop.yml @@ -129,6 +129,8 @@ jobs: - name: Print built libraries shell: bash + env: + APIS: ${{ github.event.inputs.apis}} run: | OLDIFS=$IFS IFS=',' @@ -149,6 +151,8 @@ jobs: - name: Inspect firebase libraries for cpu arch and msvc runtime. shell: bash + env: + APIS: ${{ github.event.inputs.apis}} run: | OLDIFS=$IFS IFS=',' From a6bd0cad3c950e3dd471a0345396082cb86cdcf4 Mon Sep 17 00:00:00 2001 From: Vimanyu Date: Wed, 25 Nov 2020 15:08:39 -0800 Subject: [PATCH 20/23] find only files for desktop_testapp --- .github/workflows/desktop.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/desktop.yml b/.github/workflows/desktop.yml index 507de6bf..d6fcecea 100644 --- a/.github/workflows/desktop.yml +++ b/.github/workflows/desktop.yml @@ -144,7 +144,7 @@ jobs: find $api/testapp/build -name "*.a" find $api/testapp/build -name "*.so" find $api/testapp/build -name "*.framework" - find $api/testapp/build -name "desktop_testapp*" + find -type f $api/testapp/build -name "desktop_testapp*" done set +f IFS=$OLDIFS From e0c192fb5e93958b2cb934fc15cf4750ae03aceb Mon Sep 17 00:00:00 2001 From: Vimanyu Date: Wed, 25 Nov 2020 15:20:45 -0800 Subject: [PATCH 21/23] support for md/mt windows for all firebase products quickstarts --- admob/testapp/CMakeLists.txt | 25 +++++++++++--- analytics/testapp/CMakeLists.txt | 50 ++++++++++++++++++++++----- database/testapp/CMakeLists.txt | 50 ++++++++++++++++++++++----- dynamic_links/testapp/CMakeLists.txt | 50 ++++++++++++++++++++++----- firestore/testapp/CMakeLists.txt | 51 +++++++++++++++++++++++----- functions/testapp/CMakeLists.txt | 50 ++++++++++++++++++++++----- remote_config/testapp/CMakeLists.txt | 50 ++++++++++++++++++++++----- storage/testapp/CMakeLists.txt | 50 ++++++++++++++++++++++----- 8 files changed, 315 insertions(+), 61 deletions(-) diff --git a/admob/testapp/CMakeLists.txt b/admob/testapp/CMakeLists.txt index 3a7d02dd..436203c4 100644 --- a/admob/testapp/CMakeLists.txt +++ b/admob/testapp/CMakeLists.txt @@ -62,10 +62,27 @@ if(ANDROID) else() # Build a desktop application. - # Windows runtime mode, either MD or MT depending on whether you are using - # /MD or /MT. For more information see: - # https://msdn.microsoft.com/en-us/library/2kzt1wy3.aspx - set(MSVC_RUNTIME_MODE MD) + if (MSVC) + if (MSVC_RUNTIME_LIBRARY_STATIC) + add_compile_options( + $<$:/MT> + $<$:/MTd> + $<$:/MT> + ) + # Ideally we should be setting this variable as per the Debug/Release config + # (MT vs MTd) but our prebuilt libraries don't ship with Debug builds. + set(MSVC_RUNTIME_MODE MT) + else() + add_compile_options( + $<$:/MD> + $<$:/MDd> + $<$:/MD> + ) + # Ideally we should be setting this variable as per the Debug/Release config + # (MDd vs MD)but our prebuilt libraries don't ship with Debug builds. + set(MSVC_RUNTIME_MODE MD) + endif() + endif() # Platform abstraction layer for the desktop sample. set(FIREBASE_SAMPLE_DESKTOP_SRCS diff --git a/analytics/testapp/CMakeLists.txt b/analytics/testapp/CMakeLists.txt index cd156ba0..9b832448 100644 --- a/analytics/testapp/CMakeLists.txt +++ b/analytics/testapp/CMakeLists.txt @@ -15,10 +15,27 @@ if(NOT EXISTS ${FIREBASE_CPP_SDK_DIR}) message(FATAL_ERROR "The Firebase C++ SDK directory does not exist: ${FIREBASE_CPP_SDK_DIR}. See the readme.md for more information") endif() -# Windows runtime mode, either MD or MT depending on whether you are using -# /MD or /MT. For more information see: -# https://msdn.microsoft.com/en-us/library/2kzt1wy3.aspx -set(MSVC_RUNTIME_MODE MD) +if (MSVC) + if (MSVC_RUNTIME_LIBRARY_STATIC) + add_compile_options( + $<$:/MT> + $<$:/MTd> + $<$:/MT> + ) + # Ideally we should be setting this variable as per the Debug/Release config + # (MT vs MTd) but our prebuilt libraries don't ship with Debug builds. + set(MSVC_RUNTIME_MODE MT) + else() + add_compile_options( + $<$:/MD> + $<$:/MDd> + $<$:/MD> + ) + # Ideally we should be setting this variable as per the Debug/Release config + # (MDd vs MD)but our prebuilt libraries don't ship with Debug builds. + set(MSVC_RUNTIME_MODE MD) + endif() +endif() project(firebase_testapp) @@ -69,10 +86,27 @@ if(ANDROID) else() # Build a desktop application. - # Windows runtime mode, either MD or MT depending on whether you are using - # /MD or /MT. For more information see: - # https://msdn.microsoft.com/en-us/library/2kzt1wy3.aspx - set(MSVC_RUNTIME_MODE MD) + if (MSVC) + if (MSVC_RUNTIME_LIBRARY_STATIC) + add_compile_options( + $<$:/MT> + $<$:/MTd> + $<$:/MT> + ) + # Ideally we should be setting this variable as per the Debug/Release config + # (MT vs MTd) but our prebuilt libraries don't ship with Debug builds. + set(MSVC_RUNTIME_MODE MT) + else() + add_compile_options( + $<$:/MD> + $<$:/MDd> + $<$:/MD> + ) + # Ideally we should be setting this variable as per the Debug/Release config + # (MDd vs MD)but our prebuilt libraries don't ship with Debug builds. + set(MSVC_RUNTIME_MODE MD) + endif() + endif() # Platform abstraction layer for the desktop sample. set(FIREBASE_SAMPLE_DESKTOP_SRCS diff --git a/database/testapp/CMakeLists.txt b/database/testapp/CMakeLists.txt index d505b0c9..4bebf1ef 100644 --- a/database/testapp/CMakeLists.txt +++ b/database/testapp/CMakeLists.txt @@ -15,10 +15,27 @@ if(NOT EXISTS ${FIREBASE_CPP_SDK_DIR}) message(FATAL_ERROR "The Firebase C++ SDK directory does not exist: ${FIREBASE_CPP_SDK_DIR}. See the readme.md for more information") endif() -# Windows runtime mode, either MD or MT depending on whether you are using -# /MD or /MT. For more information see: -# https://msdn.microsoft.com/en-us/library/2kzt1wy3.aspx -set(MSVC_RUNTIME_MODE MD) +if (MSVC) + if (MSVC_RUNTIME_LIBRARY_STATIC) + add_compile_options( + $<$:/MT> + $<$:/MTd> + $<$:/MT> + ) + # Ideally we should be setting this variable as per the Debug/Release config + # (MT vs MTd) but our prebuilt libraries don't ship with Debug builds. + set(MSVC_RUNTIME_MODE MT) + else() + add_compile_options( + $<$:/MD> + $<$:/MDd> + $<$:/MD> + ) + # Ideally we should be setting this variable as per the Debug/Release config + # (MDd vs MD)but our prebuilt libraries don't ship with Debug builds. + set(MSVC_RUNTIME_MODE MD) + endif() +endif() project(firebase_testapp) @@ -69,10 +86,27 @@ if(ANDROID) else() # Build a desktop application. - # Windows runtime mode, either MD or MT depending on whether you are using - # /MD or /MT. For more information see: - # https://msdn.microsoft.com/en-us/library/2kzt1wy3.aspx - set(MSVC_RUNTIME_MODE MD) + if (MSVC) + if (MSVC_RUNTIME_LIBRARY_STATIC) + add_compile_options( + $<$:/MT> + $<$:/MTd> + $<$:/MT> + ) + # Ideally we should be setting this variable as per the Debug/Release config + # (MT vs MTd) but our prebuilt libraries don't ship with Debug builds. + set(MSVC_RUNTIME_MODE MT) + else() + add_compile_options( + $<$:/MD> + $<$:/MDd> + $<$:/MD> + ) + # Ideally we should be setting this variable as per the Debug/Release config + # (MDd vs MD)but our prebuilt libraries don't ship with Debug builds. + set(MSVC_RUNTIME_MODE MD) + endif() + endif() # Platform abstraction layer for the desktop sample. set(FIREBASE_SAMPLE_DESKTOP_SRCS diff --git a/dynamic_links/testapp/CMakeLists.txt b/dynamic_links/testapp/CMakeLists.txt index 5574b351..f9a65a99 100644 --- a/dynamic_links/testapp/CMakeLists.txt +++ b/dynamic_links/testapp/CMakeLists.txt @@ -15,10 +15,27 @@ if(NOT EXISTS ${FIREBASE_CPP_SDK_DIR}) message(FATAL_ERROR "The Firebase C++ SDK directory does not exist: ${FIREBASE_CPP_SDK_DIR}. See the readme.md for more information") endif() -# Windows runtime mode, either MD or MT depending on whether you are using -# /MD or /MT. For more information see: -# https://msdn.microsoft.com/en-us/library/2kzt1wy3.aspx -set(MSVC_RUNTIME_MODE MD) +if (MSVC) + if (MSVC_RUNTIME_LIBRARY_STATIC) + add_compile_options( + $<$:/MT> + $<$:/MTd> + $<$:/MT> + ) + # Ideally we should be setting this variable as per the Debug/Release config + # (MT vs MTd) but our prebuilt libraries don't ship with Debug builds. + set(MSVC_RUNTIME_MODE MT) + else() + add_compile_options( + $<$:/MD> + $<$:/MDd> + $<$:/MD> + ) + # Ideally we should be setting this variable as per the Debug/Release config + # (MDd vs MD)but our prebuilt libraries don't ship with Debug builds. + set(MSVC_RUNTIME_MODE MD) + endif() +endif() project(firebase_testapp) @@ -69,10 +86,27 @@ if(ANDROID) else() # Build a desktop application. - # Windows runtime mode, either MD or MT depending on whether you are using - # /MD or /MT. For more information see: - # https://msdn.microsoft.com/en-us/library/2kzt1wy3.aspx - set(MSVC_RUNTIME_MODE MD) + if (MSVC) + if (MSVC_RUNTIME_LIBRARY_STATIC) + add_compile_options( + $<$:/MT> + $<$:/MTd> + $<$:/MT> + ) + # Ideally we should be setting this variable as per the Debug/Release config + # (MT vs MTd) but our prebuilt libraries don't ship with Debug builds. + set(MSVC_RUNTIME_MODE MT) + else() + add_compile_options( + $<$:/MD> + $<$:/MDd> + $<$:/MD> + ) + # Ideally we should be setting this variable as per the Debug/Release config + # (MDd vs MD)but our prebuilt libraries don't ship with Debug builds. + set(MSVC_RUNTIME_MODE MD) + endif() + endif() # Platform abstraction layer for the desktop sample. set(FIREBASE_SAMPLE_DESKTOP_SRCS diff --git a/firestore/testapp/CMakeLists.txt b/firestore/testapp/CMakeLists.txt index a4dd2727..37decaa3 100644 --- a/firestore/testapp/CMakeLists.txt +++ b/firestore/testapp/CMakeLists.txt @@ -15,10 +15,27 @@ if(NOT EXISTS ${FIREBASE_CPP_SDK_DIR}) message(FATAL_ERROR "The Firebase C++ SDK directory does not exist: ${FIREBASE_CPP_SDK_DIR}. See the readme.md for more information") endif() -# Windows runtime mode, either MD or MT depending on whether you are using -# /MD or /MT. For more information see: -# https://msdn.microsoft.com/en-us/library/2kzt1wy3.aspx -set(MSVC_RUNTIME_MODE MD) +if (MSVC) + if (MSVC_RUNTIME_LIBRARY_STATIC) + add_compile_options( + $<$:/MT> + $<$:/MTd> + $<$:/MT> + ) + # Ideally we should be setting this variable as per the Debug/Release config + # (MT vs MTd) but our prebuilt libraries don't ship with Debug builds. + set(MSVC_RUNTIME_MODE MT) + else() + add_compile_options( + $<$:/MD> + $<$:/MDd> + $<$:/MD> + ) + # Ideally we should be setting this variable as per the Debug/Release config + # (MDd vs MD)but our prebuilt libraries don't ship with Debug builds. + set(MSVC_RUNTIME_MODE MD) + endif() +endif() project(firebase_testapp) @@ -78,11 +95,27 @@ if(ANDROID) set(ADDITIONAL_LIBS) else() # Build a desktop application. - - # Windows runtime mode, either MD or MT depending on whether you are using - # /MD or /MT. For more information see: - # https://msdn.microsoft.com/en-us/library/2kzt1wy3.aspx - set(MSVC_RUNTIME_MODE MD) + if (MSVC) + if (MSVC_RUNTIME_LIBRARY_STATIC) + add_compile_options( + $<$:/MT> + $<$:/MTd> + $<$:/MT> + ) + # Ideally we should be setting this variable as per the Debug/Release config + # (MT vs MTd) but our prebuilt libraries don't ship with Debug builds. + set(MSVC_RUNTIME_MODE MT) + else() + add_compile_options( + $<$:/MD> + $<$:/MDd> + $<$:/MD> + ) + # Ideally we should be setting this variable as per the Debug/Release config + # (MDd vs MD)but our prebuilt libraries don't ship with Debug builds. + set(MSVC_RUNTIME_MODE MD) + endif() + endif() # Platform abstraction layer for the desktop sample. set(FIREBASE_SAMPLE_DESKTOP_SRCS diff --git a/functions/testapp/CMakeLists.txt b/functions/testapp/CMakeLists.txt index c6eb6903..a8cb4a12 100644 --- a/functions/testapp/CMakeLists.txt +++ b/functions/testapp/CMakeLists.txt @@ -15,10 +15,27 @@ if(NOT EXISTS ${FIREBASE_CPP_SDK_DIR}) message(FATAL_ERROR "The Firebase C++ SDK directory does not exist: ${FIREBASE_CPP_SDK_DIR}. See the readme.md for more information") endif() -# Windows runtime mode, either MD or MT depending on whether you are using -# /MD or /MT. For more information see: -# https://msdn.microsoft.com/en-us/library/2kzt1wy3.aspx -set(MSVC_RUNTIME_MODE MD) +if (MSVC) + if (MSVC_RUNTIME_LIBRARY_STATIC) + add_compile_options( + $<$:/MT> + $<$:/MTd> + $<$:/MT> + ) + # Ideally we should be setting this variable as per the Debug/Release config + # (MT vs MTd) but our prebuilt libraries don't ship with Debug builds. + set(MSVC_RUNTIME_MODE MT) + else() + add_compile_options( + $<$:/MD> + $<$:/MDd> + $<$:/MD> + ) + # Ideally we should be setting this variable as per the Debug/Release config + # (MDd vs MD)but our prebuilt libraries don't ship with Debug builds. + set(MSVC_RUNTIME_MODE MD) + endif() +endif() project(firebase_testapp) @@ -69,10 +86,27 @@ if(ANDROID) else() # Build a desktop application. - # Windows runtime mode, either MD or MT depending on whether you are using - # /MD or /MT. For more information see: - # https://msdn.microsoft.com/en-us/library/2kzt1wy3.aspx - set(MSVC_RUNTIME_MODE MD) + if (MSVC) + if (MSVC_RUNTIME_LIBRARY_STATIC) + add_compile_options( + $<$:/MT> + $<$:/MTd> + $<$:/MT> + ) + # Ideally we should be setting this variable as per the Debug/Release config + # (MT vs MTd) but our prebuilt libraries don't ship with Debug builds. + set(MSVC_RUNTIME_MODE MT) + else() + add_compile_options( + $<$:/MD> + $<$:/MDd> + $<$:/MD> + ) + # Ideally we should be setting this variable as per the Debug/Release config + # (MDd vs MD)but our prebuilt libraries don't ship with Debug builds. + set(MSVC_RUNTIME_MODE MD) + endif() + endif() # Platform abstraction layer for the desktop sample. set(FIREBASE_SAMPLE_DESKTOP_SRCS diff --git a/remote_config/testapp/CMakeLists.txt b/remote_config/testapp/CMakeLists.txt index b83676fe..ba23cacf 100644 --- a/remote_config/testapp/CMakeLists.txt +++ b/remote_config/testapp/CMakeLists.txt @@ -15,10 +15,27 @@ if(NOT EXISTS ${FIREBASE_CPP_SDK_DIR}) message(FATAL_ERROR "The Firebase C++ SDK directory does not exist: ${FIREBASE_CPP_SDK_DIR}. See the readme.md for more information") endif() -# Windows runtime mode, either MD or MT depending on whether you are using -# /MD or /MT. For more information see: -# https://msdn.microsoft.com/en-us/library/2kzt1wy3.aspx -set(MSVC_RUNTIME_MODE MD) +if (MSVC) + if (MSVC_RUNTIME_LIBRARY_STATIC) + add_compile_options( + $<$:/MT> + $<$:/MTd> + $<$:/MT> + ) + # Ideally we should be setting this variable as per the Debug/Release config + # (MT vs MTd) but our prebuilt libraries don't ship with Debug builds. + set(MSVC_RUNTIME_MODE MT) + else() + add_compile_options( + $<$:/MD> + $<$:/MDd> + $<$:/MD> + ) + # Ideally we should be setting this variable as per the Debug/Release config + # (MDd vs MD)but our prebuilt libraries don't ship with Debug builds. + set(MSVC_RUNTIME_MODE MD) + endif() +endif() project(firebase_testapp) @@ -69,10 +86,27 @@ if(ANDROID) else() # Build a desktop application. - # Windows runtime mode, either MD or MT depending on whether you are using - # /MD or /MT. For more information see: - # https://msdn.microsoft.com/en-us/library/2kzt1wy3.aspx - set(MSVC_RUNTIME_MODE MD) + if (MSVC) + if (MSVC_RUNTIME_LIBRARY_STATIC) + add_compile_options( + $<$:/MT> + $<$:/MTd> + $<$:/MT> + ) + # Ideally we should be setting this variable as per the Debug/Release config + # (MT vs MTd) but our prebuilt libraries don't ship with Debug builds. + set(MSVC_RUNTIME_MODE MT) + else() + add_compile_options( + $<$:/MD> + $<$:/MDd> + $<$:/MD> + ) + # Ideally we should be setting this variable as per the Debug/Release config + # (MDd vs MD)but our prebuilt libraries don't ship with Debug builds. + set(MSVC_RUNTIME_MODE MD) + endif() + endif() # Platform abstraction layer for the desktop sample. set(FIREBASE_SAMPLE_DESKTOP_SRCS diff --git a/storage/testapp/CMakeLists.txt b/storage/testapp/CMakeLists.txt index f885aa89..651f8e44 100644 --- a/storage/testapp/CMakeLists.txt +++ b/storage/testapp/CMakeLists.txt @@ -15,10 +15,27 @@ if(NOT EXISTS ${FIREBASE_CPP_SDK_DIR}) message(FATAL_ERROR "The Firebase C++ SDK directory does not exist: ${FIREBASE_CPP_SDK_DIR}. See the readme.md for more information") endif() -# Windows runtime mode, either MD or MT depending on whether you are using -# /MD or /MT. For more information see: -# https://msdn.microsoft.com/en-us/library/2kzt1wy3.aspx -set(MSVC_RUNTIME_MODE MD) +if (MSVC) + if (MSVC_RUNTIME_LIBRARY_STATIC) + add_compile_options( + $<$:/MT> + $<$:/MTd> + $<$:/MT> + ) + # Ideally we should be setting this variable as per the Debug/Release config + # (MT vs MTd) but our prebuilt libraries don't ship with Debug builds. + set(MSVC_RUNTIME_MODE MT) + else() + add_compile_options( + $<$:/MD> + $<$:/MDd> + $<$:/MD> + ) + # Ideally we should be setting this variable as per the Debug/Release config + # (MDd vs MD)but our prebuilt libraries don't ship with Debug builds. + set(MSVC_RUNTIME_MODE MD) + endif() +endif() project(firebase_testapp) @@ -69,10 +86,27 @@ if(ANDROID) else() # Build a desktop application. - # Windows runtime mode, either MD or MT depending on whether you are using - # /MD or /MT. For more information see: - # https://msdn.microsoft.com/en-us/library/2kzt1wy3.aspx - set(MSVC_RUNTIME_MODE MD) + if (MSVC) + if (MSVC_RUNTIME_LIBRARY_STATIC) + add_compile_options( + $<$:/MT> + $<$:/MTd> + $<$:/MT> + ) + # Ideally we should be setting this variable as per the Debug/Release config + # (MT vs MTd) but our prebuilt libraries don't ship with Debug builds. + set(MSVC_RUNTIME_MODE MT) + else() + add_compile_options( + $<$:/MD> + $<$:/MDd> + $<$:/MD> + ) + # Ideally we should be setting this variable as per the Debug/Release config + # (MDd vs MD)but our prebuilt libraries don't ship with Debug builds. + set(MSVC_RUNTIME_MODE MD) + endif() + endif() # Platform abstraction layer for the desktop sample. set(FIREBASE_SAMPLE_DESKTOP_SRCS From f276161a6c59f4966253299f91dc4d366b530c4a Mon Sep 17 00:00:00 2001 From: Vimanyu Date: Wed, 25 Nov 2020 15:28:55 -0800 Subject: [PATCH 22/23] fix find command --- .github/workflows/desktop.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/desktop.yml b/.github/workflows/desktop.yml index d6fcecea..1a302242 100644 --- a/.github/workflows/desktop.yml +++ b/.github/workflows/desktop.yml @@ -144,7 +144,7 @@ jobs: find $api/testapp/build -name "*.a" find $api/testapp/build -name "*.so" find $api/testapp/build -name "*.framework" - find -type f $api/testapp/build -name "desktop_testapp*" + find $api/testapp/build -name "desktop_testapp*" -type f done set +f IFS=$OLDIFS From 41b7cfa21d55580a21f82967a13054ccd9dfc4d2 Mon Sep 17 00:00:00 2001 From: Vimanyu Date: Tue, 1 Dec 2020 08:58:29 -0800 Subject: [PATCH 23/23] specify architecture for builds --- .github/workflows/desktop.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/desktop.yml b/.github/workflows/desktop.yml index 1a302242..3c4ddeb1 100644 --- a/.github/workflows/desktop.yml +++ b/.github/workflows/desktop.yml @@ -103,8 +103,8 @@ jobs: apilist="${APIS:-auth,messaging}" for api in $apilist; do set +f - echo "$api" - python firebase-cpp-sdk-source/scripts/build_desktop_app_with_firebase.py --sdk_dir firebase-cpp-sdk-source --app_dir $api/testapp --build_dir build --msvc_runtime_library ${{ matrix.msvc_runtime }} + echo "Building quickstart for: $api" + python firebase-cpp-sdk-source/scripts/build_desktop_app_with_firebase.py --sdk_dir firebase-cpp-sdk-source --app_dir $api/testapp --build_dir build --msvc_runtime_library ${{ matrix.msvc_runtime }} --arch ${{ matrix.architecture }} done set +f IFS=$OLDIFS