Skip to content

Instantly share code, notes, and snippets.

View dennycd's full-sized avatar

Denny C. Dai dennycd

View GitHub Profile
#include <clang-c/Index.h>
#include <cstdlib>
#include <iostream>
/*
* Compile with:
* g++ complete.cc -o complete -lclang -L/usr/lib/llvm
* Run with:
* LIBCLANG_TIMING=1 ./complete file.cc line column [clang args...]
*/
@dennycd
dennycd / gist:5949944
Created July 8, 2013 15:40
setting a xcode developer directory environemnt
export DEVELOPER_DIR = /Applications/Xcode.app/Contents/Developer
@dennycd
dennycd / gist:5949925
Created July 8, 2013 15:39
xcrun example
xcrun -find cc
xcrun cc -c source.c -o source.o
xcrun -find git
xcrun git --version
alias git="xcrun git"
@dennycd
dennycd / gist:5949857
Created July 8, 2013 15:31
select a version of xcodebuild
xcode-select -print-path //showing current setting
xcode-select -switch /Applications/Xcode-DP2.app
@dennycd
dennycd / gist:5938006
Created July 6, 2013 00:23
xcode test from command line
xcodebuild test
-scheme MyLibrary
-destination 'platform=OS X, arch=x86_64'
-destination 'platform=iOS,name=My Development iPod Touch'
-destination 'platform=iOS Simulator, name=iPhone,OS=6.1'
@dennycd
dennycd / gist:5937428
Created July 5, 2013 21:39
git ignore xcode's user state change file
git rm --cached myApp/myApp.xcodeproj/project.xcworkspace/xcuserdata/XXX.xcuserdatad/UserInterfaceState.xcuserstate
@dennycd
dennycd / gist:5896661
Created June 30, 2013 20:09
compile boost framework for iOS with c++11 enabled
# Author: Pete Goodliffe
# Copyright: (c) Copyright 2009 Pete Goodliffe
# Licence: Please feel free to use this, with attribution
#===============================================================================
#
# Builds a Boost framework for the iPhone.
# Creates a set of universal libraries that can be used on an iPhone and in the
# iPhone simulator. Then creates a pseudo-framework to make using boost in Xcode
# less painful.
#
@dennycd
dennycd / boost c++11 compile
Created June 29, 2013 09:11
Compile boost library with c++11 language and std support
./b2 toolset=clang cxxflags="-stdlib=libc++ -std=c++11" linkflags="-stdlib=libc++ -std=c++11"