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:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -9,3 +9,4 @@ build/
|
||||
.vscode/settings.json
|
||||
|
||||
ios/cxx
|
||||
macos/cxx
|
@@ -15,7 +15,7 @@ EXTERNAL SOURCES:
|
||||
|
||||
SPEC CHECKSUMS:
|
||||
Flutter: 434fef37c0980e73bb6479ef766c45957d4b510c
|
||||
flutter_qjs: 9bb46bb262be81b7c50e4a1a117d5a602d69691f
|
||||
flutter_qjs: 00a5691bdef3079061466f6fd88cd7d6986fb8b6
|
||||
|
||||
PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c
|
||||
|
||||
|
@@ -1,22 +1,23 @@
|
||||
PODS:
|
||||
- flutter_qjs (0.0.1):
|
||||
- FlutterMacOS
|
||||
- FlutterMacOS (1.0.0)
|
||||
- FlutterMacOS (1.22.4)
|
||||
|
||||
DEPENDENCIES:
|
||||
- flutter_qjs (from `Flutter/ephemeral/.symlinks/plugins/flutter_qjs/macos`)
|
||||
- FlutterMacOS (from `Flutter/ephemeral/.symlinks/flutter/darwin-x64`)
|
||||
|
||||
SPEC REPOS:
|
||||
trunk:
|
||||
- FlutterMacOS
|
||||
|
||||
EXTERNAL SOURCES:
|
||||
flutter_qjs:
|
||||
:path: Flutter/ephemeral/.symlinks/plugins/flutter_qjs/macos
|
||||
FlutterMacOS:
|
||||
:path: Flutter/ephemeral/.symlinks/flutter/darwin-x64
|
||||
|
||||
SPEC CHECKSUMS:
|
||||
flutter_qjs: f88ea7f9672fdb5fa0ad0aa2aadc4da8c0308880
|
||||
FlutterMacOS: 15bea8a44d2fa024068daa0140371c020b4b6ff9
|
||||
flutter_qjs: 1a3a4a23a9bb18d0583b5ee44d09ed9383a36e9f
|
||||
FlutterMacOS: ac210ef71944b3f04789076d70d4c72c7ec0c619
|
||||
|
||||
PODFILE CHECKSUM: d8ba9b3e9e93c62c74a660b46c6fcb09f03991a7
|
||||
|
||||
COCOAPODS: 1.9.3
|
||||
COCOAPODS: 1.10.1
|
||||
|
@@ -26,11 +26,7 @@
|
||||
33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; };
|
||||
33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; };
|
||||
33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; };
|
||||
33D1A10422148B71006C7A3E /* FlutterMacOS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 33D1A10322148B71006C7A3E /* FlutterMacOS.framework */; };
|
||||
33D1A10522148B93006C7A3E /* FlutterMacOS.framework in Bundle Framework */ = {isa = PBXBuildFile; fileRef = 33D1A10322148B71006C7A3E /* FlutterMacOS.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
8A0E1E523547DDE6AEEAA187 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E845184DF4416AE932BDD596 /* Pods_Runner.framework */; };
|
||||
D73912F022F37F9E000D13A0 /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D73912EF22F37F9E000D13A0 /* App.framework */; };
|
||||
D73912F222F3801D000D13A0 /* App.framework in Bundle Framework */ = {isa = PBXBuildFile; fileRef = D73912EF22F37F9E000D13A0 /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
@@ -50,8 +46,6 @@
|
||||
dstPath = "";
|
||||
dstSubfolderSpec = 10;
|
||||
files = (
|
||||
D73912F222F3801D000D13A0 /* App.framework in Bundle Framework */,
|
||||
33D1A10522148B93006C7A3E /* FlutterMacOS.framework in Bundle Framework */,
|
||||
);
|
||||
name = "Bundle Framework";
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
@@ -70,7 +64,6 @@
|
||||
33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Debug.xcconfig"; sourceTree = "<group>"; };
|
||||
33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Release.xcconfig"; sourceTree = "<group>"; };
|
||||
33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = "Flutter-Generated.xcconfig"; path = "ephemeral/Flutter-Generated.xcconfig"; sourceTree = "<group>"; };
|
||||
33D1A10322148B71006C7A3E /* FlutterMacOS.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = FlutterMacOS.framework; path = Flutter/ephemeral/FlutterMacOS.framework; sourceTree = SOURCE_ROOT; };
|
||||
33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = "<group>"; };
|
||||
33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = "<group>"; };
|
||||
33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = "<group>"; };
|
||||
@@ -78,7 +71,6 @@
|
||||
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = "<group>"; };
|
||||
7E8A42D81EE399E35D3B1C49 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = "<group>"; };
|
||||
D73912EF22F37F9E000D13A0 /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/ephemeral/App.framework; sourceTree = SOURCE_ROOT; };
|
||||
E845184DF4416AE932BDD596 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
ED16B55A7814C4FA5051DC2C /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
@@ -88,8 +80,6 @@
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
D73912F022F37F9E000D13A0 /* App.framework in Frameworks */,
|
||||
33D1A10422148B71006C7A3E /* FlutterMacOS.framework in Frameworks */,
|
||||
8A0E1E523547DDE6AEEAA187 /* Pods_Runner.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
@@ -145,8 +135,6 @@
|
||||
33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */,
|
||||
33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */,
|
||||
33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */,
|
||||
D73912EF22F37F9E000D13A0 /* App.framework */,
|
||||
33D1A10322148B71006C7A3E /* FlutterMacOS.framework */,
|
||||
);
|
||||
path = Flutter;
|
||||
sourceTree = "<group>";
|
||||
@@ -303,7 +291,7 @@
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "echo \"$PRODUCT_NAME.app\" > \"$PROJECT_DIR\"/Flutter/ephemeral/.app_filename\n";
|
||||
shellScript = "echo \"$PRODUCT_NAME.app\" > \"$PROJECT_DIR\"/Flutter/ephemeral/.app_filename && \"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh embed\n";
|
||||
};
|
||||
33CC111E2044C6BF0003C045 /* ShellScript */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
@@ -330,10 +318,10 @@
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputFileListPaths = (
|
||||
inputPaths = (
|
||||
);
|
||||
name = "[CP] Embed Pods Frameworks";
|
||||
outputFileListPaths = (
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
|
@@ -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
|
||||
|
@@ -53,7 +53,7 @@ final DynamicLibrary qjsLib = Platform.environment['FLUTTER_TEST'] == 'true'
|
||||
? (Platform.isWindows
|
||||
? DynamicLibrary.open("test/build/Debug/ffiquickjs.dll")
|
||||
: Platform.isMacOS
|
||||
? DynamicLibrary.open("test/build/Debug/libffiquickjs.dylib")
|
||||
? DynamicLibrary.open("test/build/libffiquickjs.dylib")
|
||||
: DynamicLibrary.process())
|
||||
: (Platform.isWindows
|
||||
? DynamicLibrary.open("flutter_qjs_plugin.dll")
|
||||
|
@@ -1,7 +0,0 @@
|
||||
cmake_minimum_required(VERSION 3.7 FATAL_ERROR)
|
||||
project(ffiquickjs LANGUAGES CXX)
|
||||
|
||||
include("${CMAKE_CURRENT_SOURCE_DIR}/../cxx/quickjs.cmake")
|
||||
|
||||
add_library(ffiquickjs SHARED ${CXX_LIB_DIR}/ffi.cpp)
|
||||
target_link_libraries(ffiquickjs PRIVATE quickjs)
|
@@ -13,12 +13,13 @@ This plugin is a simple js engine for flutter using the `quickjs` project. Plugi
|
||||
s.license = { :file => '../LICENSE' }
|
||||
s.author = { 'ekibun' => 'soekibun@gmail.com' }
|
||||
s.source = { :path => '.' }
|
||||
s.source_files = 'Classes/**/*'
|
||||
s.compiler_flags = '-DDUMP_LEAKS'
|
||||
s.source_files = ['Classes/**/*', 'cxx/*.{c,cpp}']
|
||||
s.dependency 'FlutterMacOS'
|
||||
|
||||
s.platform = :osx, '10.11'
|
||||
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' }
|
||||
s.vendored_libraries = 'build/Debug/libffiquickjs.dylib'
|
||||
s.prepare_command = 'sh make.sh'
|
||||
s.prepare_command = 'sh ../cxx/prebuild.sh'
|
||||
s.swift_version = '5.0'
|
||||
end
|
||||
|
@@ -1,12 +0,0 @@
|
||||
###
|
||||
# @Description:
|
||||
# @Author: ekibun
|
||||
# @Date: 2020-09-24 00:50:13
|
||||
# @LastEditors: ekibun
|
||||
# @LastEditTime: 2020-09-24 00:51:43
|
||||
###
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -G Xcode -DCMAKE_OSX_ARCHITECTURES=x86_64
|
||||
cmake --build . --config Debug
|
||||
cd ..
|
@@ -4,4 +4,5 @@ project(ffiquickjs LANGUAGES CXX)
|
||||
include("${CMAKE_CURRENT_SOURCE_DIR}/../cxx/quickjs.cmake")
|
||||
|
||||
add_library(ffiquickjs SHARED ${CXX_LIB_DIR}/ffi.cpp)
|
||||
target_compile_features(ffiquickjs PUBLIC cxx_std_17)
|
||||
target_link_libraries(ffiquickjs PRIVATE quickjs)
|
@@ -43,10 +43,11 @@ Future testEvaluate(qjs) async {
|
||||
}
|
||||
|
||||
void main() async {
|
||||
test('make.windows', () async {
|
||||
test('make', () async {
|
||||
final utf8Encoding = Encoding.getByName('utf-8');
|
||||
final cmakePath =
|
||||
"C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin/cmake.exe";
|
||||
final cmakePath = Platform.isWindows
|
||||
? "C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin/cmake.exe"
|
||||
: "cmake";
|
||||
final buildDir = "./build";
|
||||
var result = Process.runSync(
|
||||
cmakePath,
|
||||
@@ -69,17 +70,7 @@ void main() async {
|
||||
stdout.write(result.stdout);
|
||||
stderr.write(result.stderr);
|
||||
expect(result.exitCode, 0);
|
||||
}, testOn: 'windows');
|
||||
test('make.macos', () async {
|
||||
var result = Process.runSync(
|
||||
"sh",
|
||||
['./make.sh'],
|
||||
workingDirectory: 'macos',
|
||||
);
|
||||
stdout.write(result.stdout);
|
||||
stderr.write(result.stderr);
|
||||
expect(result.exitCode, 0);
|
||||
}, testOn: 'mac-os');
|
||||
});
|
||||
test('module', () async {
|
||||
final qjs = FlutterQjs(
|
||||
moduleHandler: (name) {
|
||||
|
11
test/make.sh
11
test/make.sh
@@ -1,11 +0,0 @@
|
||||
###
|
||||
# @Description:
|
||||
# @Author: ekibun
|
||||
# @Date: 2020-09-24 00:50:13
|
||||
# @LastEditors: ekibun
|
||||
# @LastEditTime: 2020-09-24 00:51:43
|
||||
###
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -G Xcode -DCMAKE_OSX_ARCHITECTURES=x86_64
|
||||
cmake --build . --config Debug
|
Reference in New Issue
Block a user