fix(android): don't hardcode default cmakeListsPath for pure c++ modules#2799
Open
satya164 wants to merge 1 commit into
Open
fix(android): don't hardcode default cmakeListsPath for pure c++ modules#2799satya164 wants to merge 1 commit into
cmakeListsPath for pure c++ modules#2799satya164 wants to merge 1 commit into
Conversation
…dules this removes the incorrect default `cmakeListsPath` from android autolinking for pure C++ modules. currently, the path is always defaulted to a generated file path in the library. this breaks autolinking when a C++ library doesn't ship with prebuilt codegen files (with `includesGeneratedCode: false`). after this change, it'll only use `cmakeListsPath` from user specified config. this can potentially break existing libraries if they don't specify the path. but the behavior is currently not consistent with how regular turbo modules work. related #2739
28ea5b5 to
65db3ea
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
this removes the incorrect default
cmakeListsPathfrom android autolinking for pure C++ modules.currently, the path is always defaulted to a generated file path in the library. this breaks autolinking when a C++ library doesn't ship with prebuilt codegen files (with
includesGeneratedCode: false).after this change, it'll only use
cmakeListsPathfrom user specified config.this can potentially break existing libraries if they don't specify the path.
but the behavior is currently not consistent with how regular turbo modules work.
the fix for libraries is to specify explicit
cmakeListsPathinreact-native.config.js.this only fixes part of the issue. the autolinking logic in react native also needs to be updated (PR: facebook/react-native#56938)
related #2739
Test Plan
npx create-react-native-library@latest awesome-library --yes --description "my library" --type turbo-module --languages cppyarn example androidand notice that the build worksincludesGeneratedCode: true:yarn example androidand notice that the build failsincludesGeneratedCodefacebook/react-native#56938 and notice that the module works correctlyChecklist
react-nativecheckout (instructions).