Skip to content

Commit

Permalink
Update InspectorFlags to use NDEBUG flag (#46282)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #46282

We intended to enable Fusebox on `main` since #45469 — this worked when building under Buck, however was not working for builds under Xcode/Android Studio. This is because the `HERMES_ENABLE_DEBUGGER` preprocessor flag is not equivalently defined in these build configurations.

This diff genericises these checks to `!defined(NDEBUG)` (i.e. *any debug build*), meaning we are correctly able to evaluate the `ReactNativeFeatureFlags::fuseboxEnabledDebug()` setting.

Changelog: [Internal]

NOTE: `NDEBUG` should be the as-generic-as-possible choice to select a debug build in both OSS and fbsource. Having `HERMES_ENABLE_DEBUGGER` set remains significant (AFAIK) **within the Hermes codebase** (there are no other references in `jsinspector-modern`). Evaluation of whether the lack of this flag works in OSS continues in T200241280.

Reviewed By: hoxyq

Differential Revision: D61966685

fbshipit-source-id: d30950172420a0afd6c137dbf014794f3353bb7a
  • Loading branch information
huntie authored and facebook-github-bot committed Aug 30, 2024
1 parent 4094ce0 commit f00e8ba
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,9 @@ const InspectorFlags::Values& InspectorFlags::loadFlagsAndAssertUnchanged()
true,
#elif defined(REACT_NATIVE_FORCE_DISABLE_FUSEBOX)
false,
#elif defined(HERMES_ENABLE_DEBUGGER) && \
defined(REACT_NATIVE_ENABLE_FUSEBOX_DEBUG)
#elif !defined(NDEBUG) && defined(REACT_NATIVE_ENABLE_FUSEBOX_DEBUG)
true,
#elif defined(HERMES_ENABLE_DEBUGGER)
#elif !defined(NDEBUG)
ReactNativeFeatureFlags::fuseboxEnabledDebug(),
#else
ReactNativeFeatureFlags::fuseboxEnabledRelease(),
Expand Down

0 comments on commit f00e8ba

Please sign in to comment.