Skip to content

Commit

Permalink
🔧
Browse files Browse the repository at this point in the history
  • Loading branch information
wcandillon committed Jun 18, 2024
1 parent 1185191 commit 9ba9a43
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
14 changes: 12 additions & 2 deletions package/android/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,22 @@ project(RNWGPU)
set (CMAKE_VERBOSE_MAKEFILE ON)
set (CMAKE_CXX_STANDARD 14)

add_library(react-native-webgpu SHARED
set (PACKAGE_NAME "react-native-webgpu")

add_library(${PACKAGE_NAME} SHARED
../cpp/rnwgpu/RNWebGPUManager.cpp
cpp/cpp-adapter.cpp
)

# Specifies a path to native header files.
include_directories(
../cpp
)
)

# Link
target_link_libraries(
${PACKAGE_NAME}
-ljnigraphics
-llog
-landroid
)
5 changes: 5 additions & 0 deletions package/android/cpp/cpp-adapter.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
#include <jni.h>
#include <android/log.h>

#define LOG_TAG "WebGPUModule"
#define LOGI(...) __android_log_print(ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__)

extern "C" JNIEXPORT void JNICALL
Java_com_webgpu_WebGPUModule_initializeNative(JNIEnv *env, jobject /* this */) {
// Install bindings here
LOGI("Native module initialized");
}
4 changes: 2 additions & 2 deletions package/android/src/main/java/com/webgpu/WebGPUModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ public WebGPUModule(ReactApplicationContext reactContext) {

@Override
public String getName() {
return "WebGPU";
return "WebGPUModule";
}

@ReactMethod(isBlockingSynchronousMethod = true)
public void initialize() {
public void install() {
initializeNative();
}

Expand Down

0 comments on commit 9ba9a43

Please sign in to comment.