mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-22 21:58:08 +00:00
Generate dummy .a libs dynamically according to xcode project.
This commit is contained in:
parent
9cf91c1452
commit
fac9e55456
1 changed files with 21 additions and 4 deletions
25
prepare.py
25
prepare.py
|
|
@ -137,6 +137,19 @@ def warning(platforms):
|
|||
""")
|
||||
|
||||
|
||||
def extract_libs_list():
|
||||
l = []
|
||||
regex = re.compile("lib\S+\.a")
|
||||
f = open('linphone.xcodeproj/project.pbxproj', 'r')
|
||||
lines = f.readlines()
|
||||
f.close()
|
||||
for line in lines:
|
||||
m = regex.search(line)
|
||||
if m is not None:
|
||||
l += [m.group(0)]
|
||||
return list(set(l))
|
||||
|
||||
|
||||
def main(argv=None):
|
||||
if argv is None:
|
||||
argv = sys.argv
|
||||
|
|
@ -186,6 +199,7 @@ def main(argv=None):
|
|||
makefile_platforms += [platform]
|
||||
|
||||
if makefile_platforms:
|
||||
libs_list = extract_libs_list()
|
||||
packages = os.listdir('WORK/ios-' + makefile_platforms[0] + '/Build')
|
||||
packages.sort()
|
||||
arch_targets = ""
|
||||
|
|
@ -262,6 +276,7 @@ def main(argv=None):
|
|||
makefile = """
|
||||
archs={archs}
|
||||
packages={packages}
|
||||
libs={libs}
|
||||
LINPHONE_IPHONE_VERSION=$(shell git describe --always)
|
||||
|
||||
.PHONY: all
|
||||
|
|
@ -318,9 +333,11 @@ libs: $(addprefix all-,$(archs))
|
|||
echo "[$$all_archs] Mixing `basename $$archive` in $$destpath"; \\
|
||||
lipo -create $$all_paths -output $$destpath; \\
|
||||
done && \\
|
||||
if ! test -f liblinphone-sdk/apple-darwin/lib/libtunnel.a ; then \\
|
||||
cp -f submodules/binaries/libdummy.a liblinphone-sdk/apple-darwin/lib/libtunnel.a ; \\
|
||||
fi
|
||||
for lib in $$libs ; do \\
|
||||
if ! test -f liblinphone-sdk/apple-darwin/lib/$$lib ; then \\
|
||||
cp -f submodules/binaries/libdummy.a liblinphone-sdk/apple-darwin/lib/$$lib ; \\
|
||||
fi \\
|
||||
done
|
||||
|
||||
ipa: build
|
||||
xcodebuild -configuration Release \\
|
||||
|
|
@ -365,7 +382,7 @@ help:
|
|||
@echo ""
|
||||
@echo " * sdk : re-add all generated libraries to the SDK. Use this only after a full build."
|
||||
@echo " * libs : after a rebuild of a subpackage, will mix the new libs in liblinphone-sdk/apple-darwin directory"
|
||||
""".format(archs=' '.join(makefile_platforms), arch_opts='|'.join(makefile_platforms), first_arch=makefile_platforms[0], arch_targets=arch_targets, packages=' '.join(packages), multiarch=multiarch)
|
||||
""".format(archs=' '.join(makefile_platforms), arch_opts='|'.join(makefile_platforms), first_arch=makefile_platforms[0], arch_targets=arch_targets, packages=' '.join(packages), libs=' '.join(libs_list), multiarch=multiarch)
|
||||
f = open('Makefile', 'w')
|
||||
f.write(makefile)
|
||||
f.close()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue