-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: work-around long path issues on windows (#39)
- Loading branch information
Showing
7 changed files
with
76 additions
and
22 deletions.
There are no files selected for viewing
60 changes: 60 additions & 0 deletions
60
.yarn/patches/react-native-vision-camera-npm-3.9.2-3b35d90475.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
diff --git a/android/build.gradle b/android/build.gradle | ||
index 88ea6a5b7b32dca55eeedc5b4bf255157742abdf..c1ba2dd18f2b1af7d880f5cf9c27d08638ac0221 100644 | ||
--- a/android/build.gradle | ||
+++ b/android/build.gradle | ||
@@ -1,5 +1,6 @@ | ||
import java.nio.file.Paths | ||
import com.android.Version | ||
+import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform | ||
|
||
def agpVersion = Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')[0].toInteger() | ||
def androidManifestPath = agpVersion >= 7 ? 'src/main/AndroidManifest.xml' : 'src/hasNamespace/AndroidManifest.xml' | ||
@@ -72,11 +73,27 @@ static def findNodeModules(baseDir) { | ||
|
||
def nodeModules = findNodeModules(projectDir) | ||
|
||
+static def findTools(baseDir) { | ||
+ def basePath = baseDir.toPath().normalize() | ||
+ while (basePath) { | ||
+ def toolsPath = Paths.get(basePath.toString(), "tools") | ||
+ if (toolsPath.toFile().exists()) { | ||
+ return toolsPath.toString() | ||
+ } | ||
+ basePath = basePath.getParent() | ||
+ } | ||
+ throw new GradleException("react-native-vision-camera: Failed to find tools/ path!") | ||
+} | ||
+ | ||
+def toolsDir = findTools(projectDir) | ||
+ | ||
def hasWorklets = !safeExtGetBool('VisionCamera_disableFrameProcessors', false) && findProject(":react-native-worklets-core") != null | ||
logger.warn("[VisionCamera] react-native-worklets-core ${hasWorklets ? "found" : "not found"}, Frame Processors ${hasWorklets ? "enabled" : "disabled"}!") | ||
|
||
def enableCodeScanner = safeExtGetBool('VisionCamera_enableCodeScanner', false) | ||
|
||
+def os = DefaultNativePlatform.currentOperatingSystem; | ||
+ | ||
repositories { | ||
google() | ||
mavenCentral() | ||
@@ -118,9 +135,17 @@ android { | ||
externalNativeBuild { | ||
cmake { | ||
cppFlags "-O2 -frtti -fexceptions -Wall -Wno-unused-variable -fstack-protector-all" | ||
- arguments "-DANDROID_STL=c++_shared", | ||
- "-DNODE_MODULES_DIR=${nodeModules}", | ||
- "-DENABLE_FRAME_PROCESSORS=${hasWorklets ? "ON" : "OFF"}" | ||
+ if (os.isWindows()) { | ||
+ arguments "-DANDROID_STL=c++_shared", | ||
+ "-DNODE_MODULES_DIR=${nodeModules}", | ||
+ "-DENABLE_FRAME_PROCESSORS=${hasWorklets ? "ON" : "OFF"}", | ||
+ "-DCMAKE_MAKE_PROGRAM=${toolsDir}\\windows\\ninja.exe", | ||
+ "-DCMAKE_OBJECT_PATH_MAX=1024" | ||
+ } else { | ||
+ arguments "-DANDROID_STL=c++_shared", | ||
+ "-DNODE_MODULES_DIR=${nodeModules}", | ||
+ "-DENABLE_FRAME_PROCESSORS=${hasWorklets ? "ON" : "OFF"}" | ||
+ } | ||
abiFilters (*reactNativeArchitectures()) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters