Skip to content

Commit

Permalink
Always include inspector
Browse files Browse the repository at this point in the history
Summary:
Changelog:
[Android][Changed] - Include the inspector in all build modes, and only turn it off/on at runtime.

Reviewed By: jpporto

Differential Revision: D40248901

fbshipit-source-id: f13c58f631e4617a6f157df8899e128959af450a
  • Loading branch information
Michael Anthony Leon authored and facebook-github-bot committed Dec 8, 2022
1 parent 48966eb commit 8284303
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 16 deletions.
1 change: 0 additions & 1 deletion ReactAndroid/hermes-engine/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ android {
release {
externalNativeBuild {
cmake {
arguments "-DHERMES_ENABLE_DEBUGGER=False"
arguments "-DCMAKE_BUILD_TYPE=MinSizeRel"
}
}
Expand Down
2 changes: 1 addition & 1 deletion ReactCommon/hermes/React-hermes.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Pod::Spec.new do |s|
s.pod_target_xcconfig = {
"HEADER_SEARCH_PATHS" => "\"${PODS_ROOT}/hermes-engine/destroot/include\" \"$(PODS_TARGET_SRCROOT)/..\" \"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/RCT-Folly\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/libevent/include\"",
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17"
}.merge!(build_type == :debug ? { "GCC_PREPROCESSOR_DEFINITIONS" => "HERMES_ENABLE_DEBUGGER=1" } : {})
}
s.header_dir = "reacthermes"
s.dependency "React-cxxreact", version
s.dependency "React-jsiexecutor", version
Expand Down
1 change: 0 additions & 1 deletion ReactCommon/hermes/executor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ target_link_libraries(hermes_executor_common
jsireact
hermes-engine::libhermes
jsi
debug
hermes_inspector
)

Expand Down
12 changes: 0 additions & 12 deletions ReactCommon/hermes/executor/HermesExecutorFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@
#include <hermes/hermes.h>
#include <jsi/decorator.h>

#ifdef HERMES_ENABLE_DEBUGGER
#include <hermes/inspector/RuntimeAdapter.h>
#include <hermes/inspector/chrome/Registration.h>
#endif

#include "JSITracing.h"

Expand All @@ -35,8 +33,6 @@ std::unique_ptr<HermesRuntime> makeHermesRuntimeSystraced(
return hermes::makeHermesRuntime(runtimeConfig);
}

#ifdef HERMES_ENABLE_DEBUGGER

class HermesExecutorRuntimeAdapter
: public facebook::hermes::inspector::RuntimeAdapter {
public:
Expand Down Expand Up @@ -67,8 +63,6 @@ class HermesExecutorRuntimeAdapter
std::shared_ptr<MessageQueueThread> thread_;
};

#endif

struct ReentrancyCheck {
// This is effectively a very subtle and complex assert, so only
// include it in builds which would include asserts.
Expand Down Expand Up @@ -152,7 +146,6 @@ class DecoratedRuntime : public jsi::WithRuntimeDecorator<ReentrancyCheck> {
const std::string &debuggerName)
: jsi::WithRuntimeDecorator<ReentrancyCheck>(*runtime, reentrancyCheck_),
runtime_(std::move(runtime)) {
#ifdef HERMES_ENABLE_DEBUGGER
enableDebugger_ = enableDebugger;
if (enableDebugger_) {
std::shared_ptr<HermesRuntime> rt(runtime_, &hermesRuntime);
Expand All @@ -161,15 +154,12 @@ class DecoratedRuntime : public jsi::WithRuntimeDecorator<ReentrancyCheck> {
debugToken_ = facebook::hermes::inspector::chrome::enableDebugging(
std::move(adapter), debuggerName);
}
#endif
}

~DecoratedRuntime() {
#ifdef HERMES_ENABLE_DEBUGGER
if (enableDebugger_) {
facebook::hermes::inspector::chrome::disableDebugging(debugToken_);
}
#endif
}

private:
Expand All @@ -182,10 +172,8 @@ class DecoratedRuntime : public jsi::WithRuntimeDecorator<ReentrancyCheck> {

std::shared_ptr<Runtime> runtime_;
ReentrancyCheck reentrancyCheck_;
#ifdef HERMES_ENABLE_DEBUGGER
bool enableDebugger_;
facebook::hermes::inspector::chrome::DebugSessionToken debugToken_;
#endif
};

} // namespace
Expand Down
1 change: 0 additions & 1 deletion ReactCommon/hermes/inspector/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ add_library(hermes_inspector
target_compile_options(
hermes_inspector
PRIVATE
-DHERMES_ENABLE_DEBUGGER=1
-DHERMES_INSPECTOR_FOLLY_KLUDGE=1
-std=c++17
-fexceptions
Expand Down

0 comments on commit 8284303

Please sign in to comment.