Skip to content

Commit

Permalink
update framework_info.json.template
Browse files Browse the repository at this point in the history
  • Loading branch information
rachguo authored and rachguo committed Nov 8, 2023
1 parent af3209f commit 013b520
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 30 deletions.
6 changes: 1 addition & 5 deletions cmake/onnxruntime.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,8 @@ elseif(onnxruntime_BUILD_APPLE_FRAMEWORK)
configure_file(${REPO_ROOT}/cmake/Info.plist.in ${INFO_PLIST_PATH})
if (${CMAKE_SYSTEM_NAME} STREQUAL "iOS")
configure_file(
${REPO_ROOT}/tools/ci_build/github/apple/framework_info_ios.json.template
${REPO_ROOT}/tools/ci_build/github/apple/framework_info.json.template
${CMAKE_CURRENT_BINARY_DIR}/framework_info.json)
else() #macos
configure_file(
${REPO_ROOT}/tools/ci_build/github/apple/framework_info_macos.json.template
${CMAKE_CURRENT_BINARY_DIR}/framework_info_macos.json)
endif()
set_target_properties(onnxruntime PROPERTIES
FRAMEWORK TRUE
Expand Down
21 changes: 4 additions & 17 deletions tools/ci_build/github/apple/c/assemble_c_pod_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ def assemble_c_pod_package(
public_headers_dir: pathlib.Path,
framework_dir: pathlib.Path,
package_variant: PackageVariant,
framework_info_macos_file=None,
):
"""
Assembles the files for the C/C++ pod package in a staging directory.
Expand All @@ -63,11 +62,6 @@ def assemble_c_pod_package(
framework_dir = framework_dir.resolve(strict=True)

framework_info = load_json_config(framework_info_file)
framework_info_macos = None
if framework_info_macos_file is not None:
framework_info_macos_file = framework_info_macos_file.resolve(strict=True)
framework_info_macos = load_json_config(framework_info_macos_file)

pod_config = load_json_config(get_pod_config_file(package_variant))

pod_name = pod_config["name"]
Expand All @@ -84,15 +78,16 @@ def assemble_c_pod_package(
# generate the podspec file from the template
variable_substitutions = {
"DESCRIPTION": pod_config["description"],
"IOS_DEPLOYMENT_TARGET": framework_info["IOS_DEPLOYMENT_TARGET"],
"MACOSX_DEPLOYMENT_TARGET": framework_info_macos["MACOSX_DEPLOYMENT_TARGET"] if framework_info_macos is not None else "",
# By default, we build both "iphoneos" and "iphonesimulator" architectures, and the deployment target should be the same between these two.
"IOS_DEPLOYMENT_TARGET": framework_info.get("iphoneos", {}).get("APPLE_DEPLOYMENT_TARGET", ""),
"MACOSX_DEPLOYMENT_TARGET": framework_info.get("macosx", {}).get("APPLE_DEPLOYMENT_TARGET", ""),
"LICENSE_FILE": "LICENSE",
"NAME": pod_name,
"ORT_C_FRAMEWORK": framework_dir.name,
"ORT_C_HEADERS_DIR": public_headers_dir.name,
"SUMMARY": pod_config["summary"],
"VERSION": pod_version,
"WEAK_FRAMEWORK": framework_info["WEAK_FRAMEWORK"],
"WEAK_FRAMEWORK": framework_info["macosx"]["WEAK_FRAMEWORK"],
}

podspec_template = _script_dir / "c.podspec.template"
Expand Down Expand Up @@ -140,13 +135,6 @@ def parse_args():
parser.add_argument(
"--variant", choices=PackageVariant.all_variant_names(), required=True, help="Pod package variant."
)
parser.add_argument(
"--framework-info-macos-file",
type=pathlib.Path,
required=False,
help="Path to the framework_info_macos.json file containing additional values for the podspec.(Optional) "
"This file should be generated by CMake in the build directory.",
)

return parser.parse_args()

Expand All @@ -161,7 +149,6 @@ def main():
public_headers_dir=args.public_headers_dir,
framework_dir=args.framework_dir,
package_variant=PackageVariant[args.variant],
framework_info_macos_file=args.framework_info_macos_file if args.framework_info_macos_file is not None else None,
)

return 0
Expand Down
6 changes: 6 additions & 0 deletions tools/ci_build/github/apple/framework_info.json.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"@CMAKE_OSX_SYSROOT@": {
"APPLE_DEPLOYMENT_TARGET": "@CMAKE_OSX_DEPLOYMENT_TARGET@",
"WEAK_FRAMEWORK": "@APPLE_WEAK_FRAMEWORK@"
}
}
4 changes: 0 additions & 4 deletions tools/ci_build/github/apple/framework_info_ios.json.template

This file was deleted.

This file was deleted.

0 comments on commit 013b520

Please sign in to comment.