diff --git a/src/js_list.cpp b/src/js_list.cpp index 9b01c15e..22a5ae02 100644 --- a/src/js_list.cpp +++ b/src/js_list.cpp @@ -7,6 +7,8 @@ #include "js_util.hpp" #include "object_accessor.hpp" +#include + using RJSAccessor = realm::NativeAccessor; using namespace realm; diff --git a/src/js_results.hpp b/src/js_results.hpp index 3f0e9aa1..0f58c462 100644 --- a/src/js_results.hpp +++ b/src/js_results.hpp @@ -5,6 +5,7 @@ #pragma once #include "js_util.hpp" +#include namespace realm { class Realm; diff --git a/src/js_util.cpp b/src/js_util.cpp index 409ce1b7..fcd804c3 100644 --- a/src/js_util.cpp +++ b/src/js_util.cpp @@ -48,7 +48,7 @@ std::string RJSStringForJSString(JSStringRef jsString) { } std::string RJSStringForValue(JSContextRef ctx, JSValueRef value) { - JSValueRef *exception; + JSValueRef *exception = nullptr; JSStringRef jsString = JSValueToStringCopy(ctx, value, exception); if (!jsString) { throw RJSException(ctx, *exception); diff --git a/src/js_util.hpp b/src/js_util.hpp index 061c6ec6..3cb94580 100644 --- a/src/js_util.hpp +++ b/src/js_util.hpp @@ -8,7 +8,9 @@ #include #include +#include #include + #include #include #include "property.hpp" diff --git a/tests/react-test-app/android/app/src/main/jni/Android.mk b/tests/react-test-app/android/app/src/main/jni/Android.mk index d4cff51e..96ba7abf 100644 --- a/tests/react-test-app/android/app/src/main/jni/Android.mk +++ b/tests/react-test-app/android/app/src/main/jni/Android.mk @@ -4,8 +4,6 @@ include $(CLEAR_VARS) LOCAL_MODULE := librealmreact - - LOCAL_SRC_FILES := \ js_list.cpp \ js_results.cpp \ @@ -16,14 +14,16 @@ LOCAL_SRC_FILES := \ js_schema.cpp \ rpc.cpp \ -LOCAL_CFLAGS += -fexceptions -I$(LOCAL_PATH)/inc/include -I$(LOCAL_PATH)/../../../../../../../vendor/ -std=c++11 -frtti -CXX11_FLAGS := -std=gnu++11 +LOCAL_CFLAGS += -Wall -Werror -fexceptions +CXX11_FLAGS := -std=c++11 LOCAL_CFLAGS += $(CXX11_FLAGS) LOCAL_EXPORT_CPPFLAGS := $(CXX11_FLAGS) + +LOCAL_C_INCLUDES := ../../../../../../../vendor +LOCAL_C_INCLUDES += ../../../../../../../core/include + LOCAL_SHARED_LIBRARIES := libjsc - - include $(BUILD_SHARED_LIBRARY) $(call import-module,jsc) diff --git a/tests/react-test-app/android/app/src/main/jni/Application.mk b/tests/react-test-app/android/app/src/main/jni/Application.mk index 41f9b266..daea11fe 100644 --- a/tests/react-test-app/android/app/src/main/jni/Application.mk +++ b/tests/react-test-app/android/app/src/main/jni/Application.mk @@ -7,11 +7,10 @@ APP_MK_DIR := $(dir $(lastword $(MAKEFILE_LIST))) NDK_MODULE_PATH := $(APP_MK_DIR)$(HOST_DIRSEP)$(THIRD_PARTY_NDK_DIR)$(HOST_DIRSEP)$(APP_MK_DIR)first-party -APP_STL := c++_static -APP_CFLAGS += -std=c++11 +APP_STL := c++_shared APP_CPPFLAGS += -frtti # Make sure every shared lib includes a .note.gnu.build-id header APP_LDFLAGS := -Wl,--build-id -NDK_TOOLCHAIN_VERSION := clang +NDK_TOOLCHAIN_VERSION := 4.8