-
Notifications
You must be signed in to change notification settings - Fork 7
Fix executable extensions for NDK access from Ferric #135
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -167,6 +167,8 @@ export function getTargetEnvironmentVariables({ | |
| const targetArch = getTargetAndroidArch(target); | ||
| const targetPlatform = getTargetAndroidPlatform(target); | ||
| const weakNodeApiPath = getWeakNodeApiAndroidLibraryPath(target); | ||
| const cmdMaybe = process.platform === "win32" ? ".cmd" : ""; | ||
| const exeMaybe = process.platform === "win32" ? ".exe" : ""; | ||
|
|
||
| return { | ||
| CARGO_ENCODED_RUSTFLAGS: [ | ||
|
|
@@ -177,32 +179,32 @@ export function getTargetEnvironmentVariables({ | |
| ].join(String.fromCharCode(0x1f)), | ||
| CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER: joinPathAndAssertExistence( | ||
| toolchainBinPath, | ||
| `aarch64-linux-android${androidApiLevel}-clang` | ||
| `aarch64-linux-android${androidApiLevel}-clang${cmdMaybe}` | ||
| ), | ||
| CARGO_TARGET_ARMV7_LINUX_ANDROIDEABI_LINKER: joinPathAndAssertExistence( | ||
| toolchainBinPath, | ||
| `armv7a-linux-androideabi${androidApiLevel}-clang` | ||
| `armv7a-linux-androideabi${androidApiLevel}-clang${cmdMaybe}` | ||
| ), | ||
| CARGO_TARGET_X86_64_LINUX_ANDROID_LINKER: joinPathAndAssertExistence( | ||
| toolchainBinPath, | ||
| `x86_64-linux-android${androidApiLevel}-clang` | ||
| `x86_64-linux-android${androidApiLevel}-clang${cmdMaybe}` | ||
| ), | ||
| CARGO_TARGET_I686_LINUX_ANDROID_LINKER: joinPathAndAssertExistence( | ||
| toolchainBinPath, | ||
| `i686-linux-android${androidApiLevel}-clang` | ||
| `i686-linux-android${androidApiLevel}-clang${cmdMaybe}` | ||
| ), | ||
| TARGET_CC: joinPathAndAssertExistence( | ||
| toolchainBinPath, | ||
| `${targetArch}-linux-${targetPlatform}-clang` | ||
| `${targetArch}-linux-${targetPlatform}-clang${cmdMaybe}` | ||
| ), | ||
| TARGET_CXX: joinPathAndAssertExistence( | ||
| toolchainBinPath, | ||
| `${targetArch}-linux-${targetPlatform}-clang++` | ||
| `${targetArch}-linux-${targetPlatform}-clang++${cmdMaybe}` | ||
|
Comment on lines
+182
to
+202
|
||
| ), | ||
| TARGET_AR: joinPathAndAssertExistence(toolchainBinPath, `llvm-ar`), | ||
| TARGET_AR: joinPathAndAssertExistence(toolchainBinPath, `llvm-ar${exeMaybe}`), | ||
| TARGET_RANLIB: joinPathAndAssertExistence( | ||
| toolchainBinPath, | ||
| `llvm-ranlib` | ||
| `llvm-ranlib${exeMaybe}` | ||
| ), | ||
| ANDROID_NDK: ndkPath, | ||
| PATH: `${toolchainBinPath}:${process.env.PATH}`, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The platform-suffix logic is repeated in two separate variables—consider extracting this into a small helper function to reduce duplication and clarify intent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Maybe
const isWindows = process.platform == "win32";?