Skip to content
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

Fix broken Gradle Sync when opening the project with Android Studio #39412

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions packages/rn-tester/NativeCxxModuleExample/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,17 @@ file(GLOB nativecxxmoduleexample_SRC CONFIGURE_DEPENDS *.cpp)
add_library(nativecxxmoduleexample STATIC ${nativecxxmoduleexample_SRC})

target_include_directories(nativecxxmoduleexample PUBLIC .)
target_include_directories(react_codegen_AppSpecs PUBLIC .)

target_link_libraries(nativecxxmoduleexample
fbjni
jsi
react_nativemodule_core
react_codegen_AppSpecs)
react_nativemodule_core)

# For Gradle Syncs (i.e. when you first open the project in Android Studio),
# the react_codegen_AppSpecs target is not existing yet as it's generated by
# Codegen. Therefore skip the linking with that library if it's missing in the
# CMake dependency Graph. It will be included anyway in the final build.
if (TARGET react_codegen_AppSpecs)
target_include_directories(react_codegen_AppSpecs PUBLIC .)
target_link_libraries(nativecxxmoduleexample react_codegen_AppSpecs)
endif ()