line / rules_apple_line

LINE's Apple rules for Bazel
Apache License 2.0
207 stars 18 forks source link

fatal error: 'Realm/Realm.h' file not found #30

Closed ajanuar closed 3 years ago

ajanuar commented 3 years ago

Hello maintainers,

I'd like to ask regarding this import issue. I cannot use #import <Realm/Realm.h> for apple_library depends to apple_dynamic_framework_import.

Here is my rule.

load("@build_bazel_rules_apple//apple:apple.bzl", "apple_dynamic_framework_import")
load("@rules_apple_line//apple:apple_library.bzl", "apple_library")

apple_library(
    name = "TVLStorage",
    enable_modules = True,
    hdrs = glob([
        "TVLStorage/**/*.h"
    ]),
    srcs = glob([
        "TVLStorage/**/*.m",
        "TVLStorage/**/*.swift",
    ]),
    deps = [
        ":Realm_VendorFramework",
    ],
    sdk_frameworks = [
        "Security"
    ]
)

apple_dynamic_framework_import(
    name = "Realm_VendorFramework",
    framework_imports = glob([
        "Vendor/Frameworks/realm-objc-3.21.0/Realm.framework/**"
    ]),
)

I run bazel build //Modules/TVLStorage:TVLStorage and it returns.

Use --sandbox_debug to see verbose messages from the sandbox
In file included from Modules/TVLStorage/TVLStorage/Realm/RLMRealm+SafeTransaction.m:9:
Modules/TVLStorage/TVLStorage/Realm/RLMRealm+SafeTransaction.h:9:9: fatal error: 'Realm/Realm.h' file not found
#import <Realm/Realm.h>

Any idea how to fix this issue? Thanks!