Skip to content

Commit 1cab1a8

Browse files
committed
Correctly define variables to reuse for bindings, and add missing files
1 parent 0f8ed72 commit 1cab1a8

File tree

4 files changed

+14
-7
lines changed

4 files changed

+14
-7
lines changed

bindings/megaapi.i

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#endif
2020

2121
#ifdef SWIGJAVA
22-
JavaVM *MEGAjvm = NULL;
22+
extern JavaVM* MEGAjvm;
2323
jstring strEncodeUTF8 = NULL;
2424
jclass clsString = NULL;
2525
jmethodID ctorString = NULL;
@@ -29,8 +29,8 @@ jmethodID startVideoCaptureMID = NULL;
2929
jmethodID stopVideoCaptureMID = NULL;
3030
jmethodID deviceListMID = NULL;
3131
jobject surfaceTextureHelper = NULL;
32-
jclass fileWrapper = NULL;
33-
jclass integerClass = NULL;
32+
extern jclass fileWrapper;
33+
extern jclass integerClass;
3434

3535

3636
extern "C" jint JNIEXPORT JNICALL JNI_OnLoad(JavaVM *jvm, void *reserved)

cmake/modules/sdklib_target.cmake

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,13 @@ target_sources_conditional(SDKlib
273273
src/osx/fs.cpp
274274
)
275275

276+
target_sources_conditional(SDKlib
277+
FLAG ANDROID
278+
PRIVATE
279+
include/mega/android/androidFileSystem.h
280+
src/android/androidFileSystem.cpp
281+
)
282+
276283
target_sources_conditional(SDKlib
277284
FLAG ENABLE_DRIVE_NOTIFICATIONS
278285
PRIVATE

src/android/androidFileSystem.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
#include <mega/filesystem.h>
33
#include <mega/logging.h>
44

5-
extern jclass fileWrapper;
6-
extern jclass integerClass;
7-
extern JavaVM* MEGAjvm;
5+
jclass fileWrapper = nullptr;
6+
jclass integerClass = nullptr;
7+
JavaVM* MEGAjvm = nullptr;
88

99
namespace mega
1010
{

src/posix/fs.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
#include <mega/android/androidFileSystem.h>
4343

4444
#include <jni.h>
45-
extern JavaVM *MEGAjvm;
45+
extern JavaVM* MEGAjvm;
4646
extern jclass fileWrapper;
4747
#endif
4848

0 commit comments

Comments
 (0)