mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-24 05:20:17 +00:00
backup
This commit is contained in:
parent
6038692611
commit
066a4c3936
2
.github/workflows/main.yml
vendored
2
.github/workflows/main.yml
vendored
@ -143,7 +143,7 @@ jobs:
|
||||
run: |
|
||||
bash build_darwin_libs.sh
|
||||
mkdir -p output
|
||||
cp build/Release/libpocketpy.a output/libpocketpy.a
|
||||
cp build/libpocketpy.a output/libpocketpy.a
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: darwin
|
||||
|
||||
@ -15,3 +15,5 @@ FLAGS="-DPK_BUILD_STATIC_LIB=ON \
|
||||
|
||||
cmake -G Xcode $FLAGS ..
|
||||
cmake --build . --config Release
|
||||
|
||||
python scripts/merge_built_libraries.py build
|
||||
|
||||
@ -21,11 +21,14 @@ cmake --build os64 --config Release
|
||||
cmake -B simulatorarm64 -G Xcode $FLAGS -DPLATFORM=SIMULATORARM64 ..
|
||||
cmake --build simulatorarm64 --config Release
|
||||
|
||||
HEADERS="../amalgamated/pocketpy.h"
|
||||
cd ../
|
||||
|
||||
HEADERS="amalgamated/pocketpy.h"
|
||||
|
||||
python scripts/merge_built_libraries.py build/os64
|
||||
python scripts/merge_built_libraries.py build/simulatorarm64
|
||||
|
||||
xcodebuild -create-xcframework \
|
||||
-library os64/Release-iphoneos/libpocketpy.a -headers $HEADERS \
|
||||
-library simulatorarm64/Release-iphonesimulator/libpocketpy.a -headers $HEADERS \
|
||||
-output pocketpy.xcframework
|
||||
|
||||
|
||||
-library build/os64/libpocketpy.a -headers $HEADERS \
|
||||
-library build/simulatorarm64/libpocketpy.a -headers $HEADERS \
|
||||
-output build/pocketpy.xcframework
|
||||
|
||||
2
plugins/flutter/pocketpy/.gitignore
vendored
2
plugins/flutter/pocketpy/.gitignore
vendored
@ -26,4 +26,4 @@ migrate_working_dir/
|
||||
/pubspec.lock
|
||||
**/doc/api/
|
||||
.dart_tool/
|
||||
build/
|
||||
build/
|
||||
0
plugins/flutter/pocketpy/ios/Frameworks/.gitkeep
Normal file
0
plugins/flutter/pocketpy/ios/Frameworks/.gitkeep
Normal file
@ -29,7 +29,7 @@ A new Flutter FFI plugin project.
|
||||
# Flutter.framework does not contain a i386 slice.
|
||||
s.pod_target_xcconfig = {
|
||||
'DEFINES_MODULE' => 'YES',
|
||||
'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386'
|
||||
'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386',
|
||||
'OTHER_LDFLAGS' => '-force_load ' + __dir__ + '/Frameworks/libpocketpy.a',
|
||||
}
|
||||
end
|
||||
|
||||
0
plugins/flutter/pocketpy/macos/Frameworks/.gitkeep
Normal file
0
plugins/flutter/pocketpy/macos/Frameworks/.gitkeep
Normal file
@ -25,7 +25,7 @@ A new Flutter FFI plugin project.
|
||||
s.source = { :path => '.' }
|
||||
s.source_files = 'Classes/**/*'
|
||||
s.library = 'c'
|
||||
s.pod_target_xcconfig = {
|
||||
s.pod_target_xcconfig = {
|
||||
'DEFINES_MODULE' => 'YES',
|
||||
'OTHER_LDFLAGS' => '-force_load ' + __dir__ + '/Frameworks/libpocketpy.a',
|
||||
}
|
||||
|
||||
31
scripts/merge_built_libraries.py
Normal file
31
scripts/merge_built_libraries.py
Normal file
@ -0,0 +1,31 @@
|
||||
import os, sys
|
||||
assert sys.platform == 'darwin', sys.platform
|
||||
|
||||
if len(sys.argv) == 2:
|
||||
build_dir = sys.argv[1]
|
||||
output_dir = sys.argv[1]
|
||||
elif len(sys.argv) == 3:
|
||||
build_dir = sys.argv[1]
|
||||
output_dir = sys.argv[2]
|
||||
else:
|
||||
print('Usage: python merge_built_libraries.py <build_dir> [output_dir]')
|
||||
exit(1)
|
||||
|
||||
assert os.path.exists(build_dir), build_dir
|
||||
assert os.path.exists(output_dir), output_dir
|
||||
|
||||
archives = []
|
||||
|
||||
# get all .a files in build/3rd recursive
|
||||
for root, dirs, files in os.walk(build_dir):
|
||||
for file in files:
|
||||
if file.endswith('.a') and file.startswith('lib'):
|
||||
archives.append(os.path.join(root, file))
|
||||
|
||||
print('Merging the following static libraries:')
|
||||
for archive in archives:
|
||||
print('- ' + archive)
|
||||
|
||||
# libtool -static -o libpocketpy.a
|
||||
output_archive = os.path.join(output_dir, 'libpocketpy.a')
|
||||
os.system('libtool -static -o {} {}'.format(output_archive, ' '.join(archives)))
|
||||
Loading…
x
Reference in New Issue
Block a user