@@ -367,25 +367,29 @@ target_link_libraries(firebase_app
367367 ${app_flatbuffers_lib}
368368 ${LIBSECRET_LIBRARIES}
369369)
370+ # Automatically include headers that might not be declared.
371+ # We use add_compile_options (instead of target_compile_options) so these
372+ # implicit includes apply globally to all targets in this directory,
373+ # including tests. Generator expressions ($<$<COMPILE_LANGUAGE:...>) are
374+ # used to ensure these C/C++ headers are not passed to the Swift compiler.
370375if (MSVC )
371- target_compile_options ( firebase_app PRIVATE
376+ add_compile_options (
372377 $<$<COMPILE_LANGUAGE :CXX >:/FI "assert .h " /FI "string .h " /FI "stdint .h ">)
373378elseif (APPLE )
374- target_compile_options ( firebase_app PRIVATE
379+ add_compile_options (
375380 "$<$<COMPILE_LANGUAGE :CXX >:SHELL :-include assert .h >"
376381 "$<$<COMPILE_LANGUAGE :CXX >:SHELL :-include string .h >"
377382 "$<$<COMPILE_LANGUAGE :OBJCXX >:SHELL :-include assert .h >"
378383 "$<$<COMPILE_LANGUAGE :OBJCXX >:SHELL :-include string .h >" )
379384else ()
380- target_compile_options ( firebase_app PRIVATE
385+ add_compile_options (
381386 "$<$<COMPILE_LANGUAGE :CXX >:SHELL :-include assert .h >"
382387 "$<$<COMPILE_LANGUAGE :CXX >:SHELL :-include string .h >" )
383388endif ()
384389
385390if (ANDROID )
386391 firebase_cpp_proguard_file (app )
387392elseif (IOS )
388- # Enable Automatic Reference Counting (ARC) and Bitcode.
389393 # Enable Automatic Reference Counting (ARC) for Objective-C/Swift interop
390394 target_compile_options (firebase_app
391395 PUBLIC $<$<NOT :$<COMPILE_LANGUAGE :Swift >>:-fobjc -arc >)
@@ -429,13 +433,14 @@ if (IOS)
429433 if (FIREBASE_XCODE_TARGET_FORMAT STREQUAL "frameworks" )
430434 if (FIREBASE_INCLUDE_ANALYTICS)
431435 set (analytics_HDRS
432- ${FIREBASE_SOURCE_DIR} /analytics/src/include/firebase/analytics.h
433- ${FIREBASE_GEN_FILE_DIR} /analytics/src/include/firebase/analytics/event_names.h
434- ${FIREBASE_GEN_FILE_DIR} /analytics/src/include/firebase/analytics/parameter_names.h
435- ${FIREBASE_GEN_FILE_DIR} /analytics/src/include/firebase/analytics/user_property_names.h)
436+ ${FIREBASE_SOURCE_DIR} /analytics/src/include/firebase/analytics.h
437+ ${FIREBASE_GEN_FILE_DIR} /analytics/src/include/firebase/analytics/event_names.h
438+ ${FIREBASE_GEN_FILE_DIR} /analytics/src/include/firebase/analytics/parameter_names.h
439+ ${FIREBASE_GEN_FILE_DIR} /analytics/src/include/firebase/analytics/user_property_names.h)
436440 else ()
437441 set (analytics_HDRS "" )
438442 endif ()
443+ endif ()
439444 set (app_check_HDRS
440445 ${FIREBASE_SOURCE_DIR} /app_check/src/include/firebase/app_check.h
441446 ${FIREBASE_SOURCE_DIR} /app_check/src/include/firebase/app_check/app_attest_provider.h
@@ -550,5 +555,4 @@ if (IOS)
550555 # to destination dir "Headers/google_play_services/*"
551556 set_property (SOURCE "src/include/google_play_services/availability.h" PROPERTY
552557 MACOSX_PACKAGE_LOCATION Headers/google_play_services )
553- endif () # framework_HDRS
554558endif ()
0 commit comments