Skip to content

Firebase SDK enforces -fno-exceptions for whole project #220

@dingari

Description

@dingari

[REQUIRED] Please fill in the following fields:

  • Pre-built SDK from the website or open-source from this repo: open-source
  • Firebase C++ SDK version: 6.16.0 (latest at the time of writing)
  • Problematic Firebase Component: firebase cmake script
  • Other Firebase Components in use: auth
  • Platform you are using the C++ SDK on: Mac
  • Platform you are targeting: desktop

[REQUIRED] Please describe the issue here:

I'm working on integrating the Firebase C++ SDK into an existing CMake project, just adding it via cmake_add_subdirectory

set(OPENSSL_ROOT_DIR /usr/local/opt/openssl)
set(OPENSSL_LIBRARIES /usr/local/opt/openssl/lib)
set(BUILD_TESTING OFF)
set(FIREBASE_INCLUDE_DATABASE OFF)
set(FIREBASE_INCLUDE_FIRESTORE OFF)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../../firebase ${CMAKE_CURRENT_BINARY_DIR}/firebase)

and

target_link_libraries(${TARGET} PRIVATE firebase_analytics firebase_app)

Building my target fails due to exceptions being disabled for firebase-app. My project depends on other libraries that are using exceptional C++ code. I think these lines in firebase/app/CMakeLists.txt shouldn't be using the PUBLIC attribute

# Disable exceptions in std
if (MSVC)
  target_compile_options(firebase_app PUBLIC /EHs-c-)
else()
  target_compile_options(firebase_app PUBLIC -fno-exceptions)
endif()

Changing these manually to PRIVATE allows me to compile and link just fine. Is there a reason for these being set to PUBLIC?

Steps to reproduce:

Adding the SDK to a project with exceptional C++ code will make it fail 100% of the time.

If you have a downloadable sample project that reproduces the bug you're reporting, you will
likely receive a faster response on your issue.

Relevant Code:

See description

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions