mirror of
https://github.com/wgh136/flutter_qjs.git
synced 2025-09-27 05:27:23 +00:00
quickjs msvc
This commit is contained in:
@@ -5,8 +5,6 @@
|
||||
|
||||
cmake_minimum_required(VERSION 3.4.1)
|
||||
set(JNI_LIB_NAME libjsengine)
|
||||
set(QUICK_JS_LIB_DIR ../../../../cxx/quickjspp)
|
||||
|
||||
|
||||
# Creates and names a library, sets it as either STATIC
|
||||
# or SHARED, and provides the relative paths to its source code.
|
||||
@@ -23,13 +21,14 @@ add_library( # Sets the name of the library.
|
||||
native-lib.cpp )
|
||||
|
||||
# quickjs
|
||||
file (STRINGS "${QUICK_JS_LIB_DIR}/quickjs/VERSION" QUICKJS_VERSION)
|
||||
set(QUICK_JS_LIB_DIR ../../../../cxx/quickjs)
|
||||
file (STRINGS "${QUICK_JS_LIB_DIR}/VERSION" QUICKJS_VERSION)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DCONFIG_VERSION=\\\"${QUICKJS_VERSION}\\\"")
|
||||
target_sources(${JNI_LIB_NAME} PUBLIC
|
||||
${QUICK_JS_LIB_DIR}/quickjs/cutils.c
|
||||
${QUICK_JS_LIB_DIR}/quickjs/libregexp.c
|
||||
${QUICK_JS_LIB_DIR}/quickjs/libunicode.c
|
||||
${QUICK_JS_LIB_DIR}/quickjs/quickjs.c
|
||||
${QUICK_JS_LIB_DIR}/cutils.c
|
||||
${QUICK_JS_LIB_DIR}/libregexp.c
|
||||
${QUICK_JS_LIB_DIR}/libunicode.c
|
||||
${QUICK_JS_LIB_DIR}/quickjs.c
|
||||
)
|
||||
|
||||
# Searches for a specified prebuilt library and stores the path as a
|
||||
|
@@ -3,12 +3,11 @@
|
||||
* @Author: ekibun
|
||||
* @Date: 2020-08-16 11:08:23
|
||||
* @LastEditors: ekibun
|
||||
* @LastEditTime: 2020-08-19 13:06:19
|
||||
* @LastEditTime: 2020-08-20 11:29:32
|
||||
*/
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
#include "jni_helper.hpp"
|
||||
#include <android/log.h>
|
||||
#include "../../../../cxx/js_engine.hpp"
|
||||
|
||||
namespace std
|
||||
@@ -37,7 +36,6 @@ namespace qjs
|
||||
jmethodID mid = env->GetMethodID(classclass, "getName", "()Ljava/lang/String;");
|
||||
jobject clsObj = env->CallObjectMethod(objclass, mid);
|
||||
std::string className(env->GetStringUTFChars((jstring)clsObj, 0));
|
||||
__android_log_print(ANDROID_LOG_DEBUG, "class", "class: %s", className.c_str());
|
||||
if (className.compare("[B") == 0)
|
||||
{
|
||||
jsize len = env->GetArrayLength((jbyteArray)val);
|
||||
|
Reference in New Issue
Block a user