Skip to content

Commit

Permalink
fix: add -ObjC to copts for objc_library targets
Browse files Browse the repository at this point in the history
  • Loading branch information
cgrindel committed Mar 30, 2024
1 parent a78adc9 commit 2f6fb1e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions swiftpkg/internal/swiftpkg_build_files.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,12 @@ def _clang_target_build_file(repository_ctx, pkg_ctx, target):

copts.extend(local_includes)

if target.objc_src_info != None:
# As of 2024-03-30, objc_library does not add the `-ObjC` flag during
# compilation. We need to add it for the ObjC resource bundle accessor
# to work properly.
copts.append("-ObjC")

# The `includes` attribute adds includes as -isystem which propagates
# to cc_XXX that depend upon the library. Providing includes as -I
# only provides the includes for this target.
Expand Down

0 comments on commit 2f6fb1e

Please sign in to comment.