Skip to content

Commit

Permalink
Add include directories
Browse files Browse the repository at this point in the history
  • Loading branch information
mrousavy committed Feb 21, 2024
1 parent 54cb5a4 commit edc5bb3
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions package/android/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@ set(BUILD_DIR ${CMAKE_SOURCE_DIR}/build)
set(CMAKE_VERBOSE_MAKEFILE ON)
set(CMAKE_CXX_STANDARD 17)

set(FILAMENT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/libs/filament")

# Third party libraries (Prefabs)
find_package(ReactAndroid REQUIRED CONFIG)
find_package(fbjni REQUIRED CONFIG)
find_library(LOG_LIB log)

# Filament (local CMake project as a git submodule)
add_library(libs/filament)

# Add react-native-filament sources
add_library(
${PACKAGE_NAME}
Expand Down Expand Up @@ -46,7 +45,7 @@ target_include_directories(
"${NODE_MODULES_DIR}/react-native/ReactCommon"
"${NODE_MODULES_DIR}/react-native/ReactCommon/callinvoker"
"${NODE_MODULES_DIR}/react-native/ReactAndroid/src/main/jni/react/turbomodule" # <-- CallInvokerHolder JNI wrapper
"${FILAMENT_DIR}/filament/include"
"${FILAMENT_DIR}/include"
)

# Link everything together
Expand All @@ -59,5 +58,12 @@ target_link_libraries(
fbjni::fbjni # <-- fbjni
GLESv2 # <-- OpenGL (Core)
EGL # <-- OpenGL (EGL)
filament
)

# Filament (local CMake project as a git submodule)
message("RN Filament: Adding pre-compiled libraries in ${FILAMENT_DIR}...")
file(GLOB FILAMENT_LIBRARIES "${FILAMENT_DIR}/lib/${ANDROID_ABI}/*.a")
foreach(file ${FILAMENT_LIBRARIES})
message("RN Filament: Linking ${file}...")
target_link_libraries(${PACKAGE_NAME} ${file})
endforeach()

0 comments on commit edc5bb3

Please sign in to comment.