Skip to content

Commit

Permalink
Enable hermes debugger on all build variants (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kudo authored and gabrieldonadel committed Feb 6, 2024
1 parent 417d4de commit 7cc0312
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,8 @@ android {
cmake {
arguments "-DCMAKE_BUILD_TYPE=MinSizeRel"
// For release builds, we don't want to enable the Hermes Debugger.
arguments "-DHERMES_ENABLE_DEBUGGER=False"
// For Expo Go, we have to enable debugging even on release builds.
arguments "-DHERMES_ENABLE_DEBUGGER=True"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ add_library(hermes_executor
target_compile_options(
hermes_executor
PRIVATE
$<$<CONFIG:Debug>:-DHERMES_ENABLE_DEBUGGER=1>
-DHERMES_ENABLE_DEBUGGER=1
-std=c++20
-fexceptions
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ add_library(hermesinstancejni
target_compile_options(
hermesinstancejni
PRIVATE
$<$<CONFIG:Debug>:-DHERMES_ENABLE_DEBUGGER=1>
-DHERMES_ENABLE_DEBUGGER=1
-std=c++20
-fexceptions
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ add_library(rninstance
target_compile_options(
rninstance
PRIVATE
$<$<CONFIG:Debug>:-DHERMES_ENABLE_DEBUGGER=1>
-DHERMES_ENABLE_DEBUGGER=1
-std=c++20
-fexceptions
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,6 @@ else()
hermes_executor_common
PRIVATE
-DNDEBUG
-DHERMES_ENABLE_DEBUGGER=1
)
endif()
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ if(${CMAKE_BUILD_TYPE} MATCHES Debug)
PRIVATE
-DHERMES_ENABLE_DEBUGGER=1
)
else()
# Expo Go requires debugging on release builds
target_compile_options(
hermes_inspector_modern
PRIVATE
# Expo Go requires debugging on release builds
-DHERMES_ENABLE_DEBUGGER=1
)
endif()

target_include_directories(hermes_inspector_modern PUBLIC ${REACT_COMMON_DIR})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ add_library(bridgeless
target_compile_options(
bridgeless
PRIVATE
$<$<CONFIG:Debug>:-DHERMES_ENABLE_DEBUGGER=1>
-DHERMES_ENABLE_DEBUGGER=1
-std=c++20
-fexceptions
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ react_native_path = File.join(__dir__, "..", "..")
package = JSON.parse(File.read(File.join(react_native_path, "package.json")))
version = package['version']

# Force building Hermes from source because Expo Go requires customized Hermes build
ENV['BUILD_FROM_SOURCE'] = 'true'

source_type = hermes_source_type(version, react_native_path)
source = podspec_source(source_type, version, react_native_path)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ function configure_apple_framework {
if [[ $BUILD_TYPE == "Debug" ]]; then
enable_debugger="true"
else
enable_debugger="false"
# Expo Go requires debugging on release build
enable_debugger="true"
fi
if [[ $BUILD_TYPE == "Debug" ]]; then
# JS developers aren't VM developers.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ release_version="$1"; shift
hermesc_path="$1"; shift
jsi_path="$1"; shift

enable_debugger="false"
# Expo Go requires debugging on release build
enable_debugger="true"
if [[ "$CONFIGURATION" == "Debug" ]]; then
enable_debugger="true"
fi
Expand Down

0 comments on commit 7cc0312

Please sign in to comment.