I want to link a static library (.a
file) into my code with some restrictions
In the end I ended up solving this problem by adding more parameters to the xcodebuild
command line.
Basically what you need to do is to adjust:
.h
files are located.a
is located-lCrittercism_v4_0_7
/usr/bin/xcodebuild -configuration Release clean "LIBRARY_SEARCH_PATHS=\${LIBRARY_SEARCH_PATHS} \${PROJECT_DIR}/Libraries/CrittercismSDK" "HEADER_SEARCH_PATHS=\${HEADER_SEARCH_PATHS} \${PROJECT_DIR}/Libraries/CrittercismSDK" "OTHER_LDFLAGS=-lCrittercism_v4_0_7"
With this approach you don't need to add the library to the target or to Xcode at all. If the last three parameters aren't added to the command line, the library won't belong to the final executable at all.