Skip to content

Instantly share code, notes, and snippets.

@kirb
Last active December 9, 2015 21:08
Show Gist options
  • Save kirb/4328579 to your computer and use it in GitHub Desktop.
Save kirb/4328579 to your computer and use it in GitHub Desktop.
iOS 6 SDK + theos + clang user preferences file for SublimeClang
#!/bin/bash
export THEOS=/opt/theos
export SDK=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk
if [[ "$1" =~ \.xi?m?$ ]]; then
file="$(mktemp /tmp/temp.mm.XXXXXX)"
isLogos=1
$THEOS/logos.pl "$1" > "$name" || exit 1
else
file="$1"
isLogos=0
fi
xcrun -sdk iphoneos clang++ --analyze -o - -x objective-c++ -c -DTARGET_IPHONE=1 -O2 -I"$THEOS"/include -include "$THEOS"/Prefix.pch -Wall -Werror -isysroot "$SDK" -arch armv7 -D__IPHONE_OS_VERSION_MIN_REQUIRED=__IPHONE_4_3 -miphoneos-version-min=4.3 "$file"
[[ "$isLogos" == "1" ]] && rm "$file"
{
"analyzer_commandline": [
"clangalyze"
],
"options": [],
"analyzer_extensions": [
"cpp",
"c",
"cc",
"m",
"mm",
"x",
"xi",
"xm",
"xim"
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment