-
Notifications
You must be signed in to change notification settings - Fork 90
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
Add support for mixed objective-c and pure c++ code in same apple_library #304
Conversation
@jerrymarino fyi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR and adding the example!
I'd be in favor to re-enable https://github.com/bazel-ios/rules_ios/pull/304/files#diff-23068963449a2bf4d162d813a4dda51236b9d044d1442e8a4bb4ad7680473478L867 to set the language level copts at the lib level
@@ -898,7 +898,7 @@ def apple_library(name, library_tools = {}, export_private_headers = True, names | |||
|
|||
objc_library( | |||
name = objc_libname, | |||
srcs = objc_sources + objc_private_hdrs + objc_non_exported_hdrs, | |||
srcs = objc_sources + objc_private_hdrs + objc_non_exported_hdrs + cpp_sources, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder what the the tradeoffs of this line and https://github.com/bazel-ios/rules_ios/blob/master/rules/library.bzl#L870 are ?
I don't know why https://github.com/bazel-ios/rules_ios/blob/master/rules/library.bzl#L870 was disabled, one of the problems with putting the sources in the same library is there is no way to specify the C++ specific copts at the library level.
Also Cocoapods, it compiles C++ sources as a separate |
Background:
apple_library
adds .m, .mm, .c sources as well as .hm .hh, .hpp headers headers but excludes .cc and .cpp which causes compilation error if library has pure c++ codeChanges:
Test Plan:
bazel test //tests/ios/frameworks/objcpp:ObjCppMixedLibTests
Risks:
cc_library
idea needs clarification and either should be removed and this PR merged or revived in form that will allow tests from this PR to pass