我尝试将自定义模块添加到我的Podspec中,但设置:
module_map : 'module/module.modulemap'
并在构建设置中:
xcconfig = { 'MODULEMAP_FILE' => '$(SRCROOT)/module', 'HEADER_SEARCH_PATHS' => '$(SDKROOT)/usr/include/libxml2 $(PODS_ROOT)/module $(SDKROOT)/usr/include/libresolv',
'LIBRARY_SEARCH_PATHS' => '"$(PODS_ROOT)/XMPPFramework/Vendor/libidn"', 'OTHER_LDFLAGS' => '"-lxml2"', 'CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES' => 'YES', 'ENABLE_BITCODE' => 'NO', 'SWIFT_INCLUDE_PATHS' => '$(SRCROOT)/module/module.modulemap'}
但是pod spec lint会失败,告诉我他并不知道我的自定义模块。
答案 0 :(得分:2)
我设法通过设置pod_target_xcconfig
属性来解决此问题。完整的部分看起来像这样:
s.preserve_path = 'module/module.modulemap'
s.module_map = 'module/module.modulemap'
core.pod_target_xcconfig = { 'HEADER_SEARCH_PATHS' => $(PODS_ROOT)/mypod/module }
core.xcconfig = { 'HEADER_SEARCH_PATHS' => '$(SDKROOT)/usr/include/libxml2 $(PODS_ROOT)/mypod/module }