将自定义模块添加到Podspec中的目标构建设置

时间:2015-09-01 12:02:07

标签: ios swift cocoapods podspec

我尝试将自定义模块添加到我的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会失败,告诉我他并不知道我的自定义模块。

1 个答案:

答案 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 }