SDKフレームワークヘッダーが見つからないことを示すobjc_libraryルールがあります(この問題はIOKitに固有な問題ではありません。フレームワークがまったく見つかりません)。bazelはどこでOSX SDKを探しますか(見つからない場合はどうすればよいでしょうか)?
#import <IOKit/IOKitLib.h>
致命的なエラー: 'IOKitの/ IOKitLib.h' ファイルには、私はすでに私のsdk_frameworksで "IOKitの" を持っている
が見つかりません。 /System/Library/Frameworks/IOKit.frameworkで覗いてみると、このファイルを含むディレクトリヘッダーがないことが分かります。おそらくそれはバゼルが探している場所であれば驚きではありません。
私は少し難しく見れば、私はSDKのためのより多くの結果を見つけます。
$ find /Applications/Xcode.app/ -name IOKit.framework
/Applications/Xcode.app//Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator.sdk/System/Library/Frameworks/IOKit.framework
/Applications/Xcode.app//Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/IOKit.framework
/Applications/Xcode.app//Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks/IOKit.framework
/Applications/Xcode.app//Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/IOKit.framework
/Applications/Xcode.app//Contents/Developer/Platforms/WatchSimulator.platform/Developer/SDKs/WatchSimulator.sdk/System/Library/Frameworks/IOKit.framework
/Applications/Xcode.app//Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-migrator/sdk/MacOSX.sdk/System/Library/Frameworks/IOKit.framework
MacOSX用に開発しているので、これが私が望むものだと思います。
/Applications/Xcode.app//Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/IOKit.framework
このSDKを使用するようにBazelに伝えることはできますか?私はする必要がありますか?どのようにBazelがこれらのものを探しているのかわかりますか?私はBazelの使い方にはかなり精通していますが、最も基本的なものが失敗したときにどのようにデバッグするのかは分かりません。
ここでは失敗する最も簡単な例を示します。
BUILD:
objc_library(
name = "test",
srcs = ["test.cpp"],
copts = ["-ObjC++"],
sdk_frameworks = ["IOKit"],
)
// TEST.CPP
#import <IOKit/IOKitLib.h>
私はbazel-議論する上での投稿ですが、それは多くのトラクションを取得されていません。私はBazel 0.5.2を使用しています。 https://groups.google.com/forum/#!topic/bazel-discuss/HhAjKblwHwk