bazelbuild / rules_apple

Bazel rules to build apps for Apple platforms.
Apache License 2.0
512 stars 269 forks source link

objc_framework as dep in cc_library #385

Open tpetri opened 5 years ago

tpetri commented 5 years ago

Hi,

I'm in the process of migrating our build system to Bazel. I've been trying to import the prebuilt OpenCV framework for iOS with:

apple_static_framework_import(
    name = "opencv-ios",
    framework_imports = glob(["opencv2.framework/**"]),
    visibility = ["//visibility:public"],
)

When I use it as dependency for a cc_library I get the following error:

xxx/BUILD: in deps attribute of cc_library rule //xxx: apple_static_framework_import rule '//:opencv-ios' is misplaced here (expected cc_library, objc_library, cc_proto_library or cc_import) and '//:opencv-ios' does not have mandatory providers: 'CcInfo'

The framework contains the static library that I want to use within C++ code, which is eventually linked into a iOS framework. Is this (importing a framework and linking them against cc_*) currently not possible within Bazel or am I doing something wrong here?

sergiocampama commented 5 years ago

@googlewalt ^