diff options
author | Dmitry Shevchenko <dmishe@google.com> | 2016-06-28 18:51:13 +0000 |
---|---|---|
committer | Dmitry Lomov <dslomov@google.com> | 2016-06-29 08:54:26 +0000 |
commit | d8372d22c72aa62a7dcb3e63720b2c29396c38cd (patch) | |
tree | 4f33d814e25faee38b95ffdd127cb8942fe1e8fd /src | |
parent | 4fa0bc21a871f0b95e07464c5a527b0e677d99b9 (diff) |
Improve Clang modules compilation from swift_library rule
* Passes additional defines and copts specified by objc_ rules to clang from the swift compilation.
* Adds a module cache path flag that equals to the on used by objc_ targets.
--
MOS_MIGRATED_REVID=126099975
Diffstat (limited to 'src')
-rwxr-xr-x | src/test/shell/bazel/bazel_apple_test.sh | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/test/shell/bazel/bazel_apple_test.sh b/src/test/shell/bazel/bazel_apple_test.sh index 9814dcbd8e..fa4de04ff8 100755 --- a/src/test/shell/bazel/bazel_apple_test.sh +++ b/src/test/shell/bazel/bazel_apple_test.sh @@ -166,6 +166,15 @@ EOF cat >ios/ObjcClass.h <<EOF #import <Foundation/Foundation.h> + +#if !DEFINE_FOO +#error "Define is not passed in" +#endif + +#if !COPTS_FOO +#error "Copt is not passed in +#endif + @interface ObjcClass : NSObject - (NSString *)foo; @end @@ -187,11 +196,14 @@ swift_library(name = "swift_lib", objc_library(name = "ObjcLib", hdrs = ['ObjcClass.h'], - srcs = ['ObjcClass.m']) + srcs = ['ObjcClass.m'], + defines = ["DEFINE_FOO=1"]) EOF bazel build --verbose_failures --ios_sdk_version=$IOS_SDK_VERSION \ + --objccopt=-DCOPTS_FOO=1 -s \ //ios:swift_lib >$TEST_log 2>&1 || fail "should build" + expect_log "-module-cache-path bazel-out/local-fastbuild/genfiles/_objc_module_cache" } function test_swift_import_objc_framework() { |