-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathNitroHaptics+autolinking.cmake
More file actions
59 lines (53 loc) · 2.05 KB
/
NitroHaptics+autolinking.cmake
File metadata and controls
59 lines (53 loc) · 2.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#
# NitroHaptics+autolinking.cmake
# This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
# https://github.com/mrousavy/nitro
# Copyright © 2025 Marc Rousavy @ Margelo
#
# This is a CMake file that adds all files generated by Nitrogen
# to the current CMake project.
#
# To use it, add this to your CMakeLists.txt:
# ```cmake
# include(${CMAKE_SOURCE_DIR}/../nitrogen/generated/android/NitroHaptics+autolinking.cmake)
# ```
# Add all headers that were generated by Nitrogen
include_directories(
"../nitrogen/generated/shared/c++"
"../nitrogen/generated/android/c++"
"../nitrogen/generated/android/"
)
# Add all .cpp sources that were generated by Nitrogen
target_sources(
# CMake project name (Android C++ library name)
NitroHaptics PRIVATE
# Autolinking Setup
../nitrogen/generated/android/NitroHapticsOnLoad.cpp
# Shared Nitrogen C++ sources
../nitrogen/generated/shared/c++/HybridHapticsSpec.cpp
# Android-specific Nitrogen C++ sources
../nitrogen/generated/android/c++/JHybridHapticsSpec.cpp
)
# Add all libraries required by the generated specs
find_package(fbjni REQUIRED) # <-- Used for communication between Java <-> C++
find_package(ReactAndroid REQUIRED) # <-- Used to set up React Native bindings (e.g. CallInvoker/TurboModule)
find_package(react-native-nitro-modules REQUIRED) # <-- Used to create all HybridObjects and use the Nitro core library
# Link all libraries together
target_link_libraries(
NitroHaptics
fbjni::fbjni # <-- Facebook C++ JNI helpers
ReactAndroid::jsi # <-- RN: JSI
react-native-nitro-modules::NitroModules # <-- NitroModules Core :)
)
# Link react-native (different prefab between RN 0.75 and RN 0.76)
if(ReactAndroid_VERSION_MINOR GREATER_EQUAL 76)
target_link_libraries(
NitroHaptics
ReactAndroid::reactnative # <-- RN: Native Modules umbrella prefab
)
else()
target_link_libraries(
NitroHaptics
ReactAndroid::react_nativemodule_core # <-- RN: TurboModules Core
)
endif()