diff --git a/.github/workflows/cpp-packaging.yml b/.github/workflows/cpp-packaging.yml index e34f5fb36c..16d03a6659 100644 --- a/.github/workflows/cpp-packaging.yml +++ b/.github/workflows/cpp-packaging.yml @@ -336,7 +336,7 @@ jobs: path: firebase-cpp-sdk-android-package.tgz build_desktop: - name: build-${{ matrix.sdk_platform }}-${{ matrix.architecture }}-${{ matrix.build_type }}-${{ matrix.msvc_runtime }}-${{ matrix.linux_abi }} + name: build-${{ matrix.sdk_platform }}-${{ matrix.architecture }}-${{ matrix.build_type }}-${{ matrix.msvc_runtime }} runs-on: ${{ matrix.os }} if: ${{ github.event.inputs.downloadPublicVersion == '' && github.event.inputs.downloadPreviousRun == '' }} strategy: @@ -346,7 +346,6 @@ jobs: build_type: ["Release", "Debug"] architecture: ["x64", "x86", "arm64"] msvc_runtime: ["static", "dynamic"] - linux_abi: ["legacy", "c++11"] python_version: [3.9] include: - os: windows-2022 @@ -366,14 +365,10 @@ jobs: sdk_platform: "darwin" exclude: - - os: windows-2022 - linux_abi: "c++11" - os: macos-26 architecture: "x86" - os: macos-26 msvc_runtime: "dynamic" - - os: macos-26 - linux_abi: "c++11" - os: macos-26 build_type: "Debug" - os: ubuntu-22.04 @@ -409,8 +404,8 @@ jobs: shell: bash run: | echo "VCPKG_RESPONSE_FILE=external/vcpkg_${{ matrix.vcpkg_triplet }}_response_file.txt" >> $GITHUB_ENV - echo "MATRIX_UNIQUE_NAME=${{ matrix.os }}-${{ matrix.build_type }}-${{ matrix.architecture }}-${{ matrix.python_version }}-${{ matrix.msvc_runtime }}-${{ matrix.linux_abi }}" >> $GITHUB_ENV - echo "SDK_NAME=${{ matrix.sdk_platform }}-${{ matrix.architecture }}-${{ matrix.build_type }}-${{ matrix.msvc_runtime }}-${{ matrix.linux_abi }}" >> $GITHUB_ENV + echo "MATRIX_UNIQUE_NAME=${{ matrix.os }}-${{ matrix.build_type }}-${{ matrix.architecture }}-${{ matrix.python_version }}-${{ matrix.msvc_runtime }}" >> $GITHUB_ENV + echo "SDK_NAME=${{ matrix.sdk_platform }}-${{ matrix.architecture }}-${{ matrix.build_type }}-${{ matrix.msvc_runtime }}" >> $GITHUB_ENV if [[ '${{ matrix.sdk_platform }}' == 'darwin' ]]; then # If Mac, also hash vcpkg cache on Xcode version. echo "VCPKG_EXTRA_HASH=-xcode${{env.xcodeVersion}}" >> $GITHUB_ENV @@ -425,7 +420,7 @@ jobs: uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # ratchet:actions/cache@v6 with: path: external/vcpkg/installed - key: dev-vcpkg-${{ matrix.architecture }}-${{ matrix.vcpkg_triplet_suffix }}-${{ matrix.msvc_runtime }}-${{ matrix.linux_abi }}-${{ hashFiles(format('{0}', env.VCPKG_RESPONSE_FILE)) }}-${{ hashFiles('.git/modules/external/vcpkg/HEAD') }}${{env.VCPKG_EXTRA_HASH}} + key: dev-vcpkg-${{ matrix.architecture }}-${{ matrix.vcpkg_triplet_suffix }}-${{ matrix.msvc_runtime }}-${{ hashFiles(format('{0}', env.VCPKG_RESPONSE_FILE)) }}-${{ hashFiles('.git/modules/external/vcpkg/HEAD') }}${{env.VCPKG_EXTRA_HASH}} - name: Cache ccache files if: startsWith(matrix.os, 'ubuntu') || startsWith(matrix.os, 'macos') @@ -461,7 +456,7 @@ jobs: # Run the build in the host OS default shell since Windows can't handle long path names in bash. - name: Build desktop SDK run: | - python scripts/gha/build_desktop.py --arch "${{ matrix.architecture }}" --config "${{ matrix.build_type }}" --msvc_runtime_library "${{ matrix.msvc_runtime }}" --linux_abi "${{ matrix.linux_abi }}" --build_dir out-sdk ${VERBOSE_FLAG} ${{ matrix.additional_build_flags }} --gha_build + python scripts/gha/build_desktop.py --arch "${{ matrix.architecture }}" --config "${{ matrix.build_type }}" --msvc_runtime_library "${{ matrix.msvc_runtime }}" --build_dir out-sdk ${VERBOSE_FLAG} ${{ matrix.additional_build_flags }} --gha_build - name: Archive SDK shell: bash diff --git a/AGENTS.md b/AGENTS.md index e51be98af4..1e0bdf641b 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -123,8 +123,7 @@ Common system library dependencies for desktop: * **macOS**: Common dependencies include `pthread` (system library) and frameworks like `CoreFoundation`, `Foundation`, `Security`, and `SystemConfiguration`. -* **Linux**: Common dependencies include `pthread` (system library). When - using GCC 5+, define `-D_GLIBCXX_USE_CXX11_ABI=0`. +* **Linux**: Common dependencies include `pthread` (system library). On all desktop platforms, building with -DFIREBASE_USE_BORINGSSL=YES can help bypass any OpenSSL dependency issues. diff --git a/CMakeLists.txt b/CMakeLists.txt index 36dae1d520..8c9bdf137e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -72,8 +72,6 @@ option(FIREBASE_CPP_USE_PRIOR_GRADLE_BUILD "When building with Gradle, use the previously built libraries." OFF) option(FIREBASE_USE_BORINGSSL "Build against BoringSSL instead of using your system's OpenSSL." OFF) -option(FIREBASE_USE_LINUX_CXX11_ABI - "Build Linux SDK using the C++11 ABI instead of the legacy ABI." OFF) # This should only be enabled by the GitHub Action build script. option(FIREBASE_GITHUB_ACTION_BUILD @@ -179,15 +177,6 @@ if(DESKTOP AND NOT MSVC AND NOT APPLE) # Linux-specific option. set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-maybe-uninitialized") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-maybe-uninitialized") - if (FIREBASE_LINUX_USE_CXX11_ABI) - add_definitions(-D_GLIBCXX_USE_CXX11_ABI=1) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_GLIBCXX_USE_CXX11_ABI=1") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_GLIBCXX_USE_CXX11_ABI=1") - else() - add_definitions(-D_GLIBCXX_USE_CXX11_ABI=0) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_GLIBCXX_USE_CXX11_ABI=0") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_GLIBCXX_USE_CXX11_ABI=0") - endif() endif() if(FIREBASE_GITHUB_ACTION_BUILD) diff --git a/analytics/integration_test/CMakeLists.txt b/analytics/integration_test/CMakeLists.txt index 1db8010493..3957d20fd5 100644 --- a/analytics/integration_test/CMakeLists.txt +++ b/analytics/integration_test/CMakeLists.txt @@ -161,7 +161,6 @@ if(ANDROID) set(ADDITIONAL_LIBS log android atomic native_app_glue) else() # Build a desktop application. - add_definitions(-D_GLIBCXX_USE_CXX11_ABI=0) # Prevent overriding the parent project's compiler/linker # settings on Windows diff --git a/app/integration_test/CMakeLists.txt b/app/integration_test/CMakeLists.txt index 2112f86834..d06e9aa8fd 100644 --- a/app/integration_test/CMakeLists.txt +++ b/app/integration_test/CMakeLists.txt @@ -161,7 +161,6 @@ if(ANDROID) set(ADDITIONAL_LIBS log android atomic native_app_glue) else() # Build a desktop application. - add_definitions(-D_GLIBCXX_USE_CXX11_ABI=0) # Prevent overriding the parent project's compiler/linker # settings on Windows diff --git a/app_check/integration_test/CMakeLists.txt b/app_check/integration_test/CMakeLists.txt index fd9e6deb48..2314936985 100644 --- a/app_check/integration_test/CMakeLists.txt +++ b/app_check/integration_test/CMakeLists.txt @@ -161,7 +161,6 @@ if(ANDROID) set(ADDITIONAL_LIBS log android atomic native_app_glue) else() # Build a desktop application. - add_definitions(-D_GLIBCXX_USE_CXX11_ABI=0) # Prevent overriding the parent project's compiler/linker # settings on Windows diff --git a/auth/integration_test/CMakeLists.txt b/auth/integration_test/CMakeLists.txt index 7d2ee17a4c..15875d3d5f 100644 --- a/auth/integration_test/CMakeLists.txt +++ b/auth/integration_test/CMakeLists.txt @@ -161,7 +161,6 @@ if(ANDROID) set(ADDITIONAL_LIBS log android atomic native_app_glue) else() # Build a desktop application. - add_definitions(-D_GLIBCXX_USE_CXX11_ABI=0) # Prevent overriding the parent project's compiler/linker # settings on Windows diff --git a/build_scripts/desktop/get_variant.sh b/build_scripts/desktop/get_variant.sh index f56fabdc08..d46f14eb3d 100755 --- a/build_scripts/desktop/get_variant.sh +++ b/build_scripts/desktop/get_variant.sh @@ -33,7 +33,6 @@ arch_win= debugmode=Release msvc_runtime_library=MD vs=VS2019 -linux_abi=legacy for c in $(echo "${filename}" | tr "[:upper:]" "[:lower:]" | tr "_.-" "\n\n\n"); do case $c in @@ -119,15 +118,6 @@ for c in $(echo "${filename}" | tr "[:upper:]" "[:lower:]" | tr "_.-" "\n\n\n"); debug) debugmode=Debug ;; - cxx11) - linux_abi=cxx11 - ;; - c++11) - linux_abi=cxx11 - ;; - legacy) - linux_abi=legacy - ;; vs2019) vs=VS2019 ;; @@ -158,7 +148,7 @@ case ${os} in echo "Couldn't determine architecture" 1>&2 exit 1 fi - echo -n "${arch}/${linux_abi}" + echo -n "${arch}/cxx11" ;; windows) if [[ -z "${arch_win}" ]]; then diff --git a/cmake/external_rules.cmake b/cmake/external_rules.cmake index 813f9a779c..54dad38873 100644 --- a/cmake/external_rules.cmake +++ b/cmake/external_rules.cmake @@ -217,16 +217,6 @@ function(build_external_dependencies) endif() else() # Propagate Linux build flags. - get_directory_property(CURR_DIRECTORY_DEFS COMPILE_DEFINITIONS) - if("${CURR_DIRECTORY_DEFS}" MATCHES "_GLIBCXX_USE_CXX11_ABI=0" OR - "${CMAKE_CXX_FLAGS}" MATCHES "-D_GLIBCXX_USE_CXX11_ABI=0") - set(SUBBUILD_USE_CXX11_ABI 0) - else() - set(SUBBUILD_USE_CXX11_ABI 1) - endif() - set(CMAKE_SUB_CONFIGURE_OPTIONS ${CMAKE_SUB_CONFIGURE_OPTIONS} - -DCMAKE_C_FLAGS="-D_GLIBCXX_USE_CXX11_ABI=${SUBBUILD_USE_CXX11_ABI}" - -DCMAKE_CXX_FLAGS="-D_GLIBCXX_USE_CXX11_ABI=${SUBBUILD_USE_CXX11_ABI}") if(CMAKE_TOOLCHAIN_FILE) set(CMAKE_SUB_CONFIGURE_OPTIONS ${CMAKE_SUB_CONFIGURE_OPTIONS} -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}) diff --git a/database/integration_test/CMakeLists.txt b/database/integration_test/CMakeLists.txt index a21079377d..c239ae30fd 100644 --- a/database/integration_test/CMakeLists.txt +++ b/database/integration_test/CMakeLists.txt @@ -161,7 +161,6 @@ if(ANDROID) set(ADDITIONAL_LIBS log android atomic native_app_glue) else() # Build a desktop application. - add_definitions(-D_GLIBCXX_USE_CXX11_ABI=0) # Prevent overriding the parent project's compiler/linker # settings on Windows diff --git a/firestore/integration_test/CMakeLists.txt b/firestore/integration_test/CMakeLists.txt index 4af00b0241..07fb0956b5 100644 --- a/firestore/integration_test/CMakeLists.txt +++ b/firestore/integration_test/CMakeLists.txt @@ -161,7 +161,6 @@ if(ANDROID) set(ADDITIONAL_LIBS log android atomic native_app_glue) else() # Build a desktop application. - add_definitions(-D_GLIBCXX_USE_CXX11_ABI=0) # Prevent overriding the parent project's compiler/linker # settings on Windows diff --git a/firestore/integration_test_internal/CMakeLists.txt b/firestore/integration_test_internal/CMakeLists.txt index 004f6a9707..7d2bc61df3 100644 --- a/firestore/integration_test_internal/CMakeLists.txt +++ b/firestore/integration_test_internal/CMakeLists.txt @@ -317,7 +317,6 @@ else() set(ABSEIL_CPP_ROOT ${CMAKE_CURRENT_LIST_DIR}/external/abseil-cpp/src/abseil-cpp) # Build a desktop application. - add_definitions(-D_GLIBCXX_USE_CXX11_ABI=0) # Prevent overriding the parent project's compiler/linker # settings on Windows diff --git a/functions/integration_test/CMakeLists.txt b/functions/integration_test/CMakeLists.txt index de686e7076..6651e78cde 100644 --- a/functions/integration_test/CMakeLists.txt +++ b/functions/integration_test/CMakeLists.txt @@ -161,7 +161,6 @@ if(ANDROID) set(ADDITIONAL_LIBS log android atomic native_app_glue) else() # Build a desktop application. - add_definitions(-D_GLIBCXX_USE_CXX11_ABI=0) # Prevent overriding the parent project's compiler/linker # settings on Windows diff --git a/installations/integration_test/CMakeLists.txt b/installations/integration_test/CMakeLists.txt index a4e63bd33f..c064063518 100644 --- a/installations/integration_test/CMakeLists.txt +++ b/installations/integration_test/CMakeLists.txt @@ -161,7 +161,6 @@ if(ANDROID) set(ADDITIONAL_LIBS log android atomic native_app_glue) else() # Build a desktop application. - add_definitions(-D_GLIBCXX_USE_CXX11_ABI=0) # Prevent overriding the parent project's compiler/linker # settings on Windows diff --git a/messaging/integration_test/CMakeLists.txt b/messaging/integration_test/CMakeLists.txt index c5c5724a49..096ba02647 100644 --- a/messaging/integration_test/CMakeLists.txt +++ b/messaging/integration_test/CMakeLists.txt @@ -162,7 +162,6 @@ if(ANDROID) set(ADDITIONAL_LIBS log android atomic native_app_glue) else() # Build a desktop application. - add_definitions(-D_GLIBCXX_USE_CXX11_ABI=0) # Prevent overriding the parent project's compiler/linker # settings on Windows diff --git a/release_build_files/CMakeLists.txt b/release_build_files/CMakeLists.txt index 5e4dc9208d..585b9ba654 100644 --- a/release_build_files/CMakeLists.txt +++ b/release_build_files/CMakeLists.txt @@ -49,23 +49,13 @@ elseif(MSVC) set(FIREBASE_SDK_LIBDIR ${FIREBASE_CPP_SDK_DIR}/libs/windows/${MSVC_VS_VERSION}/${MSVC_RUNTIME_MODE}/${MSVC_CPU}/${MSVC_CONFIG}) else() # LINUX - # Check whether we are building with CXX11 ABI. - get_directory_property(CURR_DIRECTORY_DEFS COMPILE_DEFINITIONS) - if ("${CURR_DIRECTORY_DEFS}" MATCHES "_GLIBCXX_USE_CXX11_ABI=0" OR - "${CMAKE_CXX_FLAGS}" MATCHES "-D_GLIBCXX_USE_CXX11_ABI=0") - set(DISABLE_CXX11 TRUE) - set(LINUX_ABI legacy) - else() - set(DISABLE_CXX11 FALSE) - set(LINUX_ABI cxx11) - endif() # Check if we are building for x86 if (" ${CMAKE_CXX_FLAGS} " MATCHES " -m32 ") set(LINUX_CPU i386) else() set(LINUX_CPU x86_64) endif() - set(FIREBASE_SDK_LIBDIR ${FIREBASE_CPP_SDK_DIR}/libs/linux/${LINUX_CPU}/${LINUX_ABI}) + set(FIREBASE_SDK_LIBDIR ${FIREBASE_CPP_SDK_DIR}/libs/linux/${LINUX_CPU}/cxx11) endif() # Defines a Firebase target, linking it with the correct prebuilt library. @@ -81,11 +71,6 @@ function(add_firebase_target TARGET_NAME) IMPORTED_LOCATION "${FIREBASE_SDK_LIBDIR}/${LIBRARY_NAME}" INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_LIST_DIR}/include" ) - if(${DISABLE_CXX11}) - set_target_properties(${TARGET_NAME} PROPERTIES - INTERFACE_COMPILE_DEFINITIONS "_GLIBCXX_USE_CXX11_ABI=0" - ) - endif() endif() endfunction() diff --git a/remote_config/integration_test/CMakeLists.txt b/remote_config/integration_test/CMakeLists.txt index e12d124c29..fba004b2a8 100644 --- a/remote_config/integration_test/CMakeLists.txt +++ b/remote_config/integration_test/CMakeLists.txt @@ -161,7 +161,6 @@ if(ANDROID) set(ADDITIONAL_LIBS log android atomic native_app_glue) else() # Build a desktop application. - add_definitions(-D_GLIBCXX_USE_CXX11_ABI=0) # Prevent overriding the parent project's compiler/linker # settings on Windows diff --git a/scripts/gha/build_desktop.py b/scripts/gha/build_desktop.py index 6cad9e604c..fb83a1fb93 100644 --- a/scripts/gha/build_desktop.py +++ b/scripts/gha/build_desktop.py @@ -132,7 +132,7 @@ def install_cpp_dependencies_with_vcpkg(arch, msvc_runtime_library, cleanup=True # could be several GBs and cause github runners to run out of space utils.clean_vcpkg_temp_data() -def cmake_configure(build_dir, arch, msvc_runtime_library='static', linux_abi='legacy', +def cmake_configure(build_dir, arch, msvc_runtime_library='static', build_tests=True, config=None, target_format=None, use_openssl=False, disable_vcpkg=False, firestore_dep_source=None, gha_build=False, verbose=False): @@ -145,7 +145,6 @@ def cmake_configure(build_dir, arch, msvc_runtime_library='static', linux_abi='l build_dir (str): Output build directory. arch (str): Platform Architecture (example: 'x64', 'x86', 'arm64'). msvc_runtime_library (str): Runtime library for MSVC (eg: 'static', 'dynamic'). - linux_abi (str): Linux ABI (eg: 'legacy', 'c++11'). build_tests (bool): Build cpp unit tests. config (str): Release/Debug config. If its not specified, cmake's default is used (most likely Debug). @@ -210,9 +209,6 @@ def cmake_configure(build_dir, arch, msvc_runtime_library='static', linux_abi='l else: cmd.append('-DCMAKE_OSX_ARCHITECTURES=x86_64') - if utils.is_linux_os() and linux_abi == 'c++11': - cmd.append('-DFIREBASE_LINUX_USE_CXX11_ABI=TRUE') - if (target_format): cmd.append('-DFIREBASE_XCODE_TARGET_FORMAT={0}'.format(target_format)) @@ -256,7 +252,7 @@ def main(): return # CMake configure - cmake_configure(args.build_dir, args.arch, args.msvc_runtime_library, args.linux_abi, + cmake_configure(args.build_dir, args.arch, args.msvc_runtime_library, args.build_tests, args.config, args.target_format, args.use_openssl, args.disable_vcpkg, args.firestore_dep_source, args.gha_build, args.verbose) @@ -277,8 +273,6 @@ def parse_cmdline_args(): parser.add_argument('-a', '--arch', default='x64', help='Platform architecture (x64, x86, arm64)') parser.add_argument('--msvc_runtime_library', default='static', help='Runtime library for MSVC (static(/MT) or dynamic(/MD)') - parser.add_argument('--linux_abi', default='legacy', - help='C++ ABI for Linux (legacy or c++11)') parser.add_argument('--build_dir', default='build', help='Output build directory') parser.add_argument('--build_tests', action='store_true', help='Build unit tests too') parser.add_argument('--verbose', action='store_true', help='Enable verbose CMake builds.') diff --git a/scripts/merge_libraries_test.py b/scripts/merge_libraries_test.py index 7a7d92509c..20a924258d 100644 --- a/scripts/merge_libraries_test.py +++ b/scripts/merge_libraries_test.py @@ -32,7 +32,7 @@ class MergeLibrariesTest(absltest.TestCase): def setUp(self): if not os.path.exists(_TEST_FILE): logging.info("Compiling merge_libraries_test_file.cc") - subprocess.run(['g++', '-O2', '-std=c++11', '-c', 'scripts/merge_libraries_test_file.cc', '-o', 'test_file.o']) + subprocess.run(['g++', '-O2', '-std=c++17', '-c', 'scripts/merge_libraries_test_file.cc', '-o', 'test_file.o']) subprocess.run([FLAGS.binutils_ar_cmd, 'rcs', _TEST_FILE, 'test_file.o']) warnings.filterwarnings("ignore", category=ResourceWarning) diff --git a/storage/integration_test/CMakeLists.txt b/storage/integration_test/CMakeLists.txt index 52cf91873d..4d79b651c3 100644 --- a/storage/integration_test/CMakeLists.txt +++ b/storage/integration_test/CMakeLists.txt @@ -161,7 +161,6 @@ if(ANDROID) set(ADDITIONAL_LIBS log android atomic native_app_glue) else() # Build a desktop application. - add_definitions(-D_GLIBCXX_USE_CXX11_ABI=0) # Prevent overriding the parent project's compiler/linker # settings on Windows diff --git a/ump/integration_test/CMakeLists.txt b/ump/integration_test/CMakeLists.txt index 00036395bd..d4694ec314 100644 --- a/ump/integration_test/CMakeLists.txt +++ b/ump/integration_test/CMakeLists.txt @@ -161,7 +161,6 @@ if(ANDROID) set(ADDITIONAL_LIBS log android atomic native_app_glue) else() # Build a desktop application. - add_definitions(-D_GLIBCXX_USE_CXX11_ABI=0) # Prevent overriding the parent project's compiler/linker # settings on Windows