CocoaPods podspec with per architecture flags -


quick version: have library of code i'm creating cocoapods spec file for. needs different compiler flags based on architecture. possible?

explanatory background: 1 of library's files contains arm neon intrinsics code. armv7 & armv7s flags are:

s.compiler_flags = '-mfloat-abi=softfp', '-mfpu=neon', '-mcpu=cortex-a9' 

the last flag causes (totally reasonable) compile error on arm64.

xcode supports per-architecture flags in build settings area, has been building fine, until when podspec wrapper required.

is there way configure cocoapods spec per-architecture flags?

one solution, found via can set architecture specific build settings in .xcconfig file in xcode 4.3?, use xcconfig:

# common flags s.compiler_flags = '-mfloat-abi=softfp', '-mfpu=neon'  # per-arch flags s.xcconfig = { 'other_cflags[arch=armv7]'  => '$(inherited) -mcpu=cortex-a9' ,                'other_cflags[arch=armv7s]' => '$(inherited) -mcpu=cortex-a9'} 

minor cocoapods bug here, $(inherited) flag double up parameters in pods.xcconfig:

other_cflags[arch=armv7] = $(inherited) -mcpu=cortex-a9 $(inherited) -mcpu=cortex-a9 other_cflags[arch=armv7s] = $(inherited) -mcpu=cortex-a9 $(inherited) -mcpu=cortex-a9 

i wonder if there's more spec-friendly way via actual compiler-flags flag?


Comments

Popular posts from this blog

c++ - OpenCV Error: Assertion failed <scn == 3 ::scn == 4> in unknown function, -

php - render data via PDO::FETCH_FUNC vs loop -

The canvas has been tainted by cross-origin data in chrome only -