mirror of
https://github.com/wgh136/flutter_qjs.git
synced 2025-09-27 05:27:23 +00:00
fix cmake build
This commit is contained in:
@@ -14,13 +14,12 @@ This plugin is a simple js engine for flutter using the `quickjs` project. Plugi
|
||||
s.author = { 'ekibun' => 'soekibun@gmail.com' }
|
||||
s.source = { :path => '.' }
|
||||
s.compiler_flags = '-DDUMP_LEAKS'
|
||||
s.source_files = ['Classes/**/*', 'cxx/*']
|
||||
s.public_header_files = 'Classes/**/*.h'
|
||||
s.source_files = ['Classes/**/*', 'cxx/*.{c,cpp}']
|
||||
s.dependency 'Flutter'
|
||||
s.platform = :ios, '8.0'
|
||||
|
||||
# Flutter.framework does not contain a i386 slice.
|
||||
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' }
|
||||
s.prepare_command = 'sh pre.sh'
|
||||
s.prepare_command = 'sh ../cxx/prebuild.sh'
|
||||
s.swift_version = '5.0'
|
||||
end
|
||||
|
33
ios/pre.sh
33
ios/pre.sh
@@ -1,33 +0,0 @@
|
||||
if [ -d "./cxx/" ];then
|
||||
rm -r ./cxx
|
||||
fi
|
||||
|
||||
mkdir ./cxx
|
||||
|
||||
sed 's/\#include \"quickjs\/quickjs.h\"/\#include \"quickjs.h\"/g' ../cxx/ffi.h > ./cxx/ffi.h
|
||||
cp ../cxx/ffi.cpp ./cxx/ffi.cpp
|
||||
|
||||
quickjs_version=$(cat ../cxx/quickjs/VERSION)
|
||||
|
||||
sed '1i\
|
||||
\#define CONFIG_VERSION \"'$quickjs_version'\"\
|
||||
' ../cxx/quickjs/quickjs.c > ./cxx/quickjs.c
|
||||
|
||||
quickjs_src=(
|
||||
"list.h"
|
||||
"cutils.c"
|
||||
"libregexp.c"
|
||||
"libunicode.c"
|
||||
"cutils.h"
|
||||
"libregexp.h"
|
||||
"libunicode.h"
|
||||
"quickjs.h"
|
||||
"quickjs-atom.h"
|
||||
"quickjs-opcode.h"
|
||||
"libregexp-opcode.h"
|
||||
"libunicode-table.h"
|
||||
)
|
||||
for item in ${quickjs_src[*]}
|
||||
do
|
||||
cp ../cxx/quickjs/$item ./cxx/$item
|
||||
done
|
Reference in New Issue
Block a user