Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not use full path for system libraries and frameworks in .xcodeproj #867

Merged
merged 1 commit into from
Sep 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion .ci/test_project.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,22 @@ set -eo pipefail

toolchain create Touchtracer kivy-ci-clone/examples/demo/touchtracer

# If runner arch is arm64, then the simulator arch is arm64,
# otherwise it's x86_64
if [ $(arch) == "arm64" ]; then
SIM_ARCH="arm64"
else
SIM_ARCH="x86_64"
fi

# Build for iOS
xcodebuild -project touchtracer-ios/touchtracer.xcodeproj \
-scheme touchtracer \
-destination generic/platform=iOS\
clean build CODE_SIGNING_ALLOWED=NO | xcpretty
clean build CODE_SIGNING_ALLOWED=NO | xcpretty

# Build for iOS Simulator
xcodebuild -project touchtracer-ios/touchtracer.xcodeproj \
-scheme touchtracer \
-destination 'generic/platform=iOS Simulator' \
clean build CODE_SIGNING_ALLOWED=NO ARCHS=$SIM_ARCH | xcpretty
3 changes: 2 additions & 1 deletion kivy_ios/recipes/zbarlight/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ class ZbarLightRecipe(Recipe):
url = "https://github.com/Polyconseil/zbarlight/archive/{version}.tar.gz"
library = "zbarlight.a"
depends = ["hostpython3", "python3", "libzbar"]
pbx_libraries = ["libz", "libbz2", "libc++", "libsqlite3", "CoreMotion"]
pbx_libraries = ["libz", "libbz2", "libc++", "libsqlite3"]
pbx_frameworks = ["CoreMotion"]
include_per_platform = True

def get_zbar_env(self, plat):
Expand Down
18 changes: 8 additions & 10 deletions kivy_ios/toolchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -1322,7 +1322,6 @@ def update_pbxproj(filename, pbx_frameworks=None):
logger.info("Analysis of {}".format(filename))

project = XcodeProject.load(filename)
sysroot = sh.xcrun("--sdk", "iphonesimulator", "--show-sdk-path").strip()

group = project.get_or_create_group("Frameworks")
g_classes = project.get_or_create_group("Classes")
Expand All @@ -1333,8 +1332,9 @@ def update_pbxproj(filename, pbx_frameworks=None):
f_path = join(ctx.dist_dir, "frameworks", framework_name)
else:
logger.info("Ensure {} is in the project (pbx_frameworks, system)".format(framework))
f_path = join(sysroot, "System", "Library", "Frameworks",
"{}.framework".format(framework))
# We do not need to specify the full path to the framework, as
# Xcode will search for it in the SDKs.
f_path = framework_name
project.add_file(
f_path,
parent=group,
Expand All @@ -1346,13 +1346,11 @@ def update_pbxproj(filename, pbx_frameworks=None):
),
)
for library in pbx_libraries:
logger.info("Ensure {} is in the project (pbx_libraries, dylib+tbd)".format(library))
f_path = join(sysroot, "usr", "lib",
"{}.dylib".format(library))
project.add_file(f_path, parent=group, tree="DEVELOPER_DIR", force=False)
f_path = join(sysroot, "usr", "lib",
"{}.tbd".format(library))
project.add_file(f_path, parent=group, tree="DEVELOPER_DIR", force=False)
library_name = f"{library}.tbd"
logger.info("Ensure {} is in the project (pbx_libraries, tbd)".format(library))
# We do not need to specify the full path to the library, as
# Xcode will search for it in the SDKs.
project.add_file(library_name, parent=group, tree="DEVELOPER_DIR", force=False)
for xcframework in xcframeworks:
logger.info("Ensure {} is in the project (xcframework)".format(xcframework))
project.add_file(
Expand Down