Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build error from react-native 0.74.3 #205

Merged
merged 3 commits into from
Jul 6, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add REACT_NATIVE_PATCH_VERSION defines
  • Loading branch information
Kudo committed Jul 6, 2024
commit ff812602b6da309fc7e2235654c834947446ba38
6 changes: 4 additions & 2 deletions RNV8.podspec
Original file line number Diff line number Diff line change
@@ -11,7 +11,9 @@ end
if ENV["REACT_NATIVE_OVERRIDE_VERSION"]
reactNativeVersion = ENV["REACT_NATIVE_OVERRIDE_VERSION"]
end
reactNativeTargetVersion = reactNativeVersion.split('.')[1].to_i
reactNativeVersions = reactNativeVersion.split('.')
reactNativeMinorVersion = reactNativeVersions[1].to_i
reactNativePatchVersion = reactNativeVersions[2].to_i

folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -DFOLLY_CFG_NO_COROUTINES=1 -Wno-comma -Wno-shorten-64-to-32'

@@ -33,7 +35,7 @@ Pod::Spec.new do |s|
'HEADER_SEARCH_PATHS' => "\"$(PODS_ROOT)/boost\"",
}

compiler_flags = folly_compiler_flags + ' ' + "-DREACT_NATIVE_MINOR_VERSION=#{reactNativeTargetVersion}"
compiler_flags = folly_compiler_flags + ' ' + "-DREACT_NATIVE_MINOR_VERSION=#{reactNativeMinorVersion} -DREACT_NATIVE_PATCH_VERSION=#{reactNativePatchVersion}"
s.compiler_flags = compiler_flags

s.dependency 'v8-ios'
2 changes: 1 addition & 1 deletion android/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@ else()
set (CMAKE_CXX_STANDARD 17)
endif()

string(APPEND CMAKE_CXX_FLAGS " -DREACT_NATIVE_MINOR_VERSION=${REACT_NATIVE_MINOR_VERSION} -fexceptions -fno-omit-frame-pointer -frtti -Wno-sign-compare -fstack-protector-all")
string(APPEND CMAKE_CXX_FLAGS " -DREACT_NATIVE_MINOR_VERSION=${REACT_NATIVE_MINOR_VERSION} -DREACT_NATIVE_PATCH_VERSION=${REACT_NATIVE_PATCH_VERSION} -fexceptions -fno-omit-frame-pointer -frtti -Wno-sign-compare -fstack-protector-all")

include("${REACT_NATIVE_DIR}/ReactAndroid/cmake-utils/folly-flags.cmake")
add_compile_options(${folly_FLAGS})
2 changes: 2 additions & 0 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -41,6 +41,7 @@ def reactNativeManifestAsJson = new JsonSlurper().parseText(reactNativeManifest.
def reactNativeVersion = reactNativeManifestAsJson.version as String
def (major, minor, patch) = reactNativeVersion.tokenize('.')
def rnMinorVersion = Integer.parseInt(minor)
def rnPatchVersion = Integer.parseInt(patch)
def extractSoDir = "${buildDir}/jniLibs"
def prefabHeadersDir = "${buildDir}/prefab-headers"

@@ -136,6 +137,7 @@ android {
arguments "-DANDROID_STL=c++_shared",
"-DREACT_NATIVE_DIR=${toPlatformFileString(reactNativeDir)}",
"-DREACT_NATIVE_MINOR_VERSION=${rnMinorVersion}",
"-DREACT_NATIVE_PATCH_VERSION=${rnPatchVersion}",
"-DV8_ANDROID_DIR=${v8AndroidDir}",
"-DSO_DIR=${extractSoDir}"
targets "v8executor"