-
Notifications
You must be signed in to change notification settings - Fork 7
Use CMake file API to read shared library target paths #254
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 6 commits
ae4fc87
0d6edf6
e2ede36
7dc3078
034e66b
52ec31d
4d0b7df
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 |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "cmake-rn": patch | ||
| --- | ||
|
|
||
| Use CMake file API to read shared library target paths |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -45,7 +45,7 @@ type XCframeworkOptions = { | |||||||||
| autoLink: boolean; | ||||||||||
| }; | ||||||||||
|
|
||||||||||
| export function createAppleFramework(libraryPath: string) { | ||||||||||
| export async function createAppleFramework(libraryPath: string) { | ||||||||||
| assert(fs.existsSync(libraryPath), `Library not found: ${libraryPath}`); | ||||||||||
| // Write a info.plist file to the framework | ||||||||||
| const libraryName = path.basename(libraryPath, path.extname(libraryPath)); | ||||||||||
|
|
@@ -54,11 +54,11 @@ export function createAppleFramework(libraryPath: string) { | |||||||||
| `${libraryName}.framework`, | ||||||||||
| ); | ||||||||||
| // Create the framework from scratch | ||||||||||
| fs.rmSync(frameworkPath, { recursive: true, force: true }); | ||||||||||
| fs.mkdirSync(frameworkPath); | ||||||||||
| fs.mkdirSync(path.join(frameworkPath, "Headers")); | ||||||||||
| await fs.promises.rm(frameworkPath, { recursive: true, force: true }); | ||||||||||
| await fs.promises.mkdir(frameworkPath); | ||||||||||
| await fs.promises.mkdir(path.join(frameworkPath, "Headers")); | ||||||||||
| // Create an empty Info.plist file | ||||||||||
| fs.writeFileSync( | ||||||||||
| await fs.promises.writeFile( | ||||||||||
| path.join(frameworkPath, "Info.plist"), | ||||||||||
| createPlistContent({ | ||||||||||
| CFBundleDevelopmentRegion: "en", | ||||||||||
|
|
@@ -75,8 +75,9 @@ export function createAppleFramework(libraryPath: string) { | |||||||||
| ); | ||||||||||
| const newLibraryPath = path.join(frameworkPath, libraryName); | ||||||||||
| // TODO: Consider copying the library instead of renaming it | ||||||||||
| fs.renameSync(libraryPath, newLibraryPath); | ||||||||||
| await fs.promises.rename(libraryPath, newLibraryPath); | ||||||||||
| // Update the name of the library | ||||||||||
| // TODO: Make this call async | ||||||||||
| cp.spawnSync("install_name_tool", [ | ||||||||||
|
||||||||||
| // TODO: Make this call async | |
| cp.spawnSync("install_name_tool", [ | |
| // Make this call async | |
| await spawn("install_name_tool", [ |
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.
Bug: CMake API Version Mismatch
The CMake file API query uses version "2", but
readCurrentTargetsDeepreads targets with version "2.0". This version string inconsistency can cause the read operation to fail or return unexpected results.Additional Locations (1)
packages/cmake-rn/src/platforms/android.ts#L131-L136