File tree 5 files changed +20
-1
lines changed
ReactAndroid/src/main/jni/first-party/fb
5 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,9 @@ add_compile_options(
21
21
-Wno-error=unused-but-set-variable
22
22
-DHAVE_POSIX_CLOCKS
23
23
)
24
+ if (${CMAKE_BUILD_TYPE} MATCHES Release)
25
+ add_compile_options (-DNDEBUG)
26
+ endif ()
24
27
25
28
# Yogacore needs to link towards android and log from the NDK libs
26
29
target_link_libraries (fb dl android log )
Original file line number Diff line number Diff line change @@ -28,4 +28,10 @@ if(${CMAKE_BUILD_TYPE} MATCHES Debug)
28
28
PRIVATE
29
29
-DHERMES_ENABLE_DEBUGGER=1
30
30
)
31
+ else ()
32
+ target_compile_options (
33
+ hermes_executor_common
34
+ PRIVATE
35
+ -DNDEBUG
36
+ )
31
37
endif ()
Original file line number Diff line number Diff line change @@ -33,3 +33,7 @@ target_link_libraries(jscruntime
33
33
# TODO: Remove this flag when ready.
34
34
# Android has this enabled by default, but the flag is still needed for iOS.
35
35
target_compile_options (jscruntime PRIVATE -DRN_FABRIC_ENABLED)
36
+
37
+ if (${CMAKE_BUILD_TYPE} MATCHES Release)
38
+ target_compile_options (jscruntime PRIVATE -DNDEBUG)
39
+ endif ()
Original file line number Diff line number Diff line change @@ -22,3 +22,7 @@ add_library(react_debug SHARED ${react_debug_SRC})
22
22
target_include_directories (react_debug PUBLIC ${REACT_COMMON_DIR} )
23
23
24
24
target_link_libraries (react_debug log folly_runtime)
25
+
26
+ if (${CMAKE_BUILD_TYPE} MATCHES Release)
27
+ target_compile_options (react_debug PUBLIC -DNDEBUG)
28
+ endif ()
Original file line number Diff line number Diff line change 10
10
//
11
11
// Enable REACT_NATIVE_DEBUG if NDEBUG is not defined.
12
12
// Due to BUCK defaults in open-source, NDEBUG is always defined for all android
13
- // builds (if you build without BUCK, this isn't an issue). Thus we introduce
13
+ // builds.
14
+ // If you build in OSS with CMake, you will have -DNDEBUG set only for release
15
+ // builds, therefore REACT_NATIVE_DEBUG will not be set. Here we introduce
14
16
// REACT_NATIVE_DEBUG that we use internally instead of NDEBUG that we can
15
17
// control and use as a more reliable xplat flag. For any build that doesn't
16
18
// have NDEBUG defined, we enable REACT_NATIVE_DEBUG for convenience.
You can’t perform that action at this time.
0 commit comments