Skip to content

Commit

Permalink
fix: path build issues on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
dcangulo committed Feb 3, 2024
1 parent d87125c commit 0d8f7a5
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import org.apache.tools.ant.taskdefs.condition.Os

buildscript {
repositories {
google()
Expand All @@ -9,6 +11,14 @@ buildscript {
}
}

String toPlatformFileString(File path) {
def result = path.toString()
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
result = result.replace(File.separatorChar, '/' as char)
}
return result
}

def isNewArchitectureEnabled() {
return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
}
Expand Down Expand Up @@ -57,7 +67,7 @@ android {
externalNativeBuild {
cmake {
cppFlags "-O2 -frtti -fexceptions -Wall -fstack-protector-all"
arguments "-DNODE_MODULES_DIR=${rootDir}/../node_modules"
arguments "-DNODE_MODULES_DIR=${toPlatformFileString(rootDir)}/../node_modules"
}
}
}
Expand Down

0 comments on commit 0d8f7a5

Please sign in to comment.