C++ 如何将BUCK build与具有多个同名文件的pod一起使用?
我正试着用巴克来对付他 我已将我的buck文件设置为:C++ 如何将BUCK build与具有多个同名文件的pod一起使用?,c++,ios,realm,cocoapods,buck,C++,Ios,Realm,Cocoapods,Buck,我正试着用巴克来对付他 我已将我的buck文件设置为: apple_pod_lib( name = "Realm", visibility = ["PUBLIC"], exported_headers = glob([ "Realm/**/*.h", "Realm/**/*.hpp", ]), srcs = glob([ "Realm/**/.{m,mm,cpp}", ]), ) apple_pod
apple_pod_lib(
name = "Realm",
visibility = ["PUBLIC"],
exported_headers = glob([
"Realm/**/*.h",
"Realm/**/*.hpp",
]),
srcs = glob([
"Realm/**/.{m,mm,cpp}",
]),
)
apple_pod_lib(
name = "RealmSwift",
visibility = ["PUBLIC"],
swift_version = "4",
deps = [
"//Pods:Realm"
],
srcs = glob([
"RealmSwift/**/*.swift",
]),
)
使用中的pod宏
然而,我不能建立我的项目,因为这失败了
In target '//Pods:Realm', 'Realm/history.hpp' maps to the following header files:
- /BuckSample/Pods/Realm/include/core/realm/sync/history.hpp
- /BuckSample/Pods/Realm/include/core/realm/history.hpp
Please rename one of them or export one of them to a different path.
我还尝试手动指定要包含的文件和标题,查看那些repo中的PodSpec,但我无法让它工作,因为当时我缺少了一些文件供项目在Xcode中编译。作为一种解决方法,我能够通过Carthage安装预构建的框架,如下所示:
# Cartfile
github "realm/realm-cocoa"
# Carthage/BUCK
prebuilt_apple_framework(
name = "Realm",
framework = "Build/iOS/Realm.framework",
preferred_linkage = "shared",
visibility = ["PUBLIC"],
)
prebuilt_apple_framework(
name = "RealmSwift",
framework = "Build/iOS/RealmSwift.framework",
preferred_linkage = "shared",
visibility = ["PUBLIC"],
deps = [
":Realm",
]
)
# Where my library is
apple_library(
name = "LibraryWithRealm",
visibility = ["PUBLIC"],
swift_version = "5.0",
modular = True,
deps = [
"//Carthage:RealmSwift",
]
)
看起来我需要它来让BUCK保留标题的路径,而不是试图将所有内容导出到“history.hpp”,这样才有意义