From 1c2dda047281df6ec8eb3da91ddc8c27ee23f80b Mon Sep 17 00:00:00 2001 From: Chuck Grindel Date: Sat, 28 Sep 2024 10:58:42 -0600 Subject: [PATCH] Add back the special handling the for the SWIFTPM_MODULE_BUNDLE. --- swiftpkg/internal/swiftpkg_build_files.bzl | 30 +++++++++++----------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/swiftpkg/internal/swiftpkg_build_files.bzl b/swiftpkg/internal/swiftpkg_build_files.bzl index 4e8e22839..db893ada3 100644 --- a/swiftpkg/internal/swiftpkg_build_files.bzl +++ b/swiftpkg/internal/swiftpkg_build_files.bzl @@ -260,23 +260,23 @@ def _clang_target_build_file(repository_ctx, pkg_ctx, target): clang_apple_res_bundle_info.bundle_label_name, )) if clang_apple_res_bundle_info.objc_accessor_hdr_label_name: - # srcs.extend([ - # ":{}".format( - # clang_apple_res_bundle_info.objc_accessor_hdr_label_name, - # ), - # # NOTE: We add the implementation below based upon what - # # type of target is using the implementation. - # ]) + srcs.extend([ + ":{}".format( + clang_apple_res_bundle_info.objc_accessor_hdr_label_name, + ), + # NOTE: We add the implementation as a dependency on a target + # that compiles the implementation. + ]) deps.append(":" + clang_apple_res_bundle_info.objc_accessor_library_label_name) - # # SPM provides a SWIFTPM_MODULE_BUNDLE macro to access the bundle for - # # ObjC code. The header file contains the macro definition. It needs - # # to be available in every Objc source file. So, we specify the - # # -include flag specifying the header path. - # # https://github.com/apple/swift-package-manager/blob/8387798811c6cc43761c5e1b48df2d3412dc5de4/Sources/Build/BuildDescription/ClangTargetBuildDescription.swift#L390 - # res_copts.append("-include$(location :{})".format( - # clang_apple_res_bundle_info.objc_accessor_hdr_label_name, - # )) + # SPM provides a SWIFTPM_MODULE_BUNDLE macro to access the bundle for + # ObjC code. The header file contains the macro definition. It needs + # to be available in every Objc source file. So, we specify the + # -include flag specifying the header path. + # https://github.com/apple/swift-package-manager/blob/8387798811c6cc43761c5e1b48df2d3412dc5de4/Sources/Build/BuildDescription/ClangTargetBuildDescription.swift#L390 + res_copts.append("-include$(location :{})".format( + clang_apple_res_bundle_info.objc_accessor_hdr_label_name, + )) local_includes = [ bzl_selects.new(value = p, kind = _condition_kinds.private_includes)