Closed cgrindel closed 1 month ago
We can emulate local_defines
with copts
though. We should do so on both swift_library
and objc_library
.
We can emulate local_defines with copts though. We should do so on both swift_library and objc_library.
@brentleyjones Can you elaborate on that? Do you mean specifying -DSWIFT_PACKAGE=1
directly?
Yes :+1:. But without =1
for swift_library
.
So, do we want to keep all defines local or just the SWIFT_PACKAGE
? We apply other define values, as well. They can be specified as build settings. I am checking the source to see what it does, because the doc is not clear.
I don't see any code that propagates the define values. So, I will update the code to set all defines as local.
@brentleyjones Is there any background why the defines
for swift_library
propagate? Is it just matching the cc_library
behavior?
Yes. It would make more sense to behave that way if you could have a source-less swift_library
, but at least it's consistent with cc_library
.
@brentleyjones @luispadron This PR is ready for review. It now uses copts
for defines.
In an attempt to localize defines to specific targets, we specify defines/macros for all target types (e.g.,
swift_library
,objc_library
, andcc_library
) targets usingcopts
.Fixes #1093.