Skip to content

Commit afdbd86

Browse files
committed
Pass headerpad_max_install_names to linker
1 parent 178f205 commit afdbd86

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

.changeset/clear-peas-fly.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"cmake-rn": patch
3+
---
4+
5+
Fix auto-linking failures due to lack of padding when renaming install name of libraries, by passing headerpad_max_install_names argument to linker.

packages/cmake-rn/src/platforms/apple.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,8 @@ export const platform: Platform<Triplet[], AppleOpts> = {
278278
CMAKE_SYSTEM_NAME: CMAKE_SYSTEM_NAMES[triplet],
279279
CMAKE_OSX_SYSROOT: XCODE_SDK_NAMES[triplet],
280280
CMAKE_OSX_ARCHITECTURES: APPLE_ARCHITECTURES[triplet],
281+
// Passing a linker flag to increase the header pad size to allow renaming the install name when linking it into the app.
282+
CMAKE_SHARED_LINKER_FLAGS: "-Wl,-headerpad_max_install_names",
281283
},
282284
{
283285
// Setting the output directories works around an issue with Xcode generator

0 commit comments

Comments
 (0)