When you usually create a library, ENABLE_BITCODE=YES , Xcode adds the -fembed-bitcode-marker assembly flag to any clang call, placing the "empty" bitcode in the last o file.
So, if you look at compilation in the build phase, it will look something like this:
CompileC {build_path} /StaticBitcode/StaticLogger.o StaticBitcode / StaticLogger.m normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler cd {path} / StaticBitcode export LANG = ru_US.US-ASCII export PATH = "/Applications/Xcode.app/Contents/Developer/Platforms / iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/USR/ben : / bin: / USR / SBIN: / SBIN "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c -arch armv7 -fmessage-length = 0 -fdiagnostics -show-note-include-stack -fmacro-backtrace -limit = 0 -std = gnu99 -fobjc-arc -fmodules -gmodules -fmodules-cache- [...] -fembed-bitcode-marker [...]
This applies to assembly action (regardless of purpose).
When you are Build & Archive , the -fembed flag -fembed replaced with -fembed-bitcode , which does create binary code that supports bit code:
CompileC {build_path} /StaticBitcode/StaticLogger.o StaticBitcode / StaticLogger.m normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler cd {path} / StaticBitcode export LANG = ru_US.US-ASCII export PATH = "/Applications/Xcode.app/Contents/Developer/Platforms / iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/USR/ben : / bin: / USR / SBIN: / SBIN "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c -arch armv7 -fmessage-length = 0 -fdiagnostics -show-note-include-stack -fmacro-backtrace -limit = 0 -std = gnu99 -fobjc-arc -fmodules -gmodules -fmodules-cache- [...] -fembed-bitcode [...]
fembed-bitcode flag
Given that
If you add the -fembed-bitcode flag to the Other C flags, you will send two flags to the compiler at compile time. You might turn off some warnings you might get when using the library associated with another project. But you need to check if you have the expected behavior. :)
(When I tested with -fembed-bitcode on other C flags, Xcode issued a warning clang: warning: argument unused during compilation: '-fembed-bitcode-marker' )
BITCODE_GENERATION_MODE
On the other hand,
If you set BITCODE_GENERATION_MODE=bitcode to User-defined Setting , even during the build phase, the files will be compiled using the -fembed-bitcode .
And, if you set BITCODE_GENERATION_MODE=marker , the files will be compiled using the -fembed-bitcode-marker flag, regardless of the phase of action.
So, if you want to include a bit code for each action (build and archive), the best way to do this is to use the BITCODE_GENERATION_MODE parameter.
Resources