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 Jul 17, 2024
1 parent b4121a9 commit 0f27db3
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,8 @@ android {
cmake {
arguments(
"-DCMAKE_BUILD_TYPE=MinSizeRel",
// For release builds, we don't want to enable the Hermes Debugger.
"-DHERMES_ENABLE_DEBUGGER=False")
// For Expo Go, we have to enable debugging even on release builds.
"-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 @@ -25,6 +25,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['RCT_BUILD_HERMES_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 @@ -63,7 +63,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 @@ -36,7 +36,8 @@ function get_deployment_target {
echo "${IPHONEOS_DEPLOYMENT_TARGET}"
}

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 0f27db3

Please sign in to comment.