Skip to content

Make the hardcoded CODE_SIGNING_ALLOWED and ANDROID_STL build settings configurable #418

Description

@kraenhansen

Two TODOs in cmake-rn, one per platform, where a build setting is pinned to the value that suits our own test app and cannot be overridden by a consumer.

Two separate PRs.

Apple: code signing is always disabled

// Skip code-signing (needed when building free dynamic libraries)
// TODO: Make this configurable
"CODE_SIGNING_ALLOWED=NO",
]);

CODE_SIGNING_ALLOWED=NO is the right default for the free-standing dynamic libraries we produce, but it is passed unconditionally. A consumer who needs signed binaries in the XCFramework — enterprise distribution, or a target whose downstream tooling verifies signatures — has no way to ask for it.

Android: the STL is always c++_shared

https://github.com/callstackincubator/react-native-node-api/blob/29a527d87fa8cb965b0048b1b4c1cff2b0eab281/packages/cmake-rn/src/platforms/android.ts#L152-L154

c++_shared is the correct choice for an app that loads several native libraries, and matches what React Native itself uses, so it should stay the default. But an addon that is genuinely self-contained may want c++_static, and — more importantly — an addon that must match a prebuilt third-party dependency has no say today. Getting this wrong is not a build error; it surfaces as duplicate STL symbols or subtle allocator mismatches at runtime, which makes the lack of an escape hatch worse than usual.

Both are single values that want the same treatment: keep the current value as the default, and let it be overridden. Note that #227 (pass-through of arbitrary runtime arguments to CMake) may cover the Android case for free — worth settling that first, since a generic pass-through would subsume ANDROID_STL but not the Xcode-level CODE_SIGNING_ALLOWED, which is appended after -- to xcodebuild rather than passed at configure time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    AutomatableAn issue we expect to be fixed using automation.CMake RNOur `cmake` wrapping CLIenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions