Skip to content

Instantly share code, notes, and snippets.

@jviereck
Created October 28, 2015 10:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jviereck/6d153d23b4befb63323e to your computer and use it in GitHub Desktop.
Save jviereck/6d153d23b4befb63323e to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="UTF-8" ?>
<config
Name="Xcode Clang++"
ShortName="Clang++"
Manufacturer="Apple"
Version=""
Language="C++"
Priority="A"
Location="$XCODE_DIR" >
<Details
CompilerExecutable="$CXX"
CompilerDefines="$DEFINES"
CompilerFlags="$CXXFLAGS"
OptimizationFlags="$CXXOPTIMFLAGS"
DebugFlags="$CXXDEBUGFLAGS"
IncludeFlags="$INCLUDE"
LinkerLibraries="$LINKLIBS"
LinkerOptimizationFlags="$LDOPTIMFLAGS"
LinkerDebugFlags="$LDDEBUGFLAGS"
CompilerDefineFormatter="-D%s"
LinkerLibrarySwitchFormatter="-l%s"
LinkerPathFormatter="-L%s"
/>
<vars
CMDLINE100="$CXX -c $DEFINES $INCLUDE $CXXFLAGS $OPTIM $SRC -o $OBJ"
CMDLINE200="$LDXX $LDFLAGS $LINKOPTIM $LINKEXPORT $OBJS $CXXLIBS $LINKLIBS -o $EXE"
CMDLINE300="rm -f $OBJ"
CXX="$XCRUN_DIR/xcrun -sdk macosx$SDKVER clang++"
DEFINES="$MATLABMEX"
MATLABMEX="-DMATLAB_MEX_FILE "
CXXFLAGS="-fno-common -arch x86_64 -mmacosx-version-min=$SDKVER -fexceptions -isysroot $ISYSROOT -fobjc-arc"
INCLUDE="-I&quot;$MATLABROOT/extern/include&quot; -I&quot;$MATLABROOT/simulink/include&quot;"
CXXOPTIMFLAGS="-O2 -DNDEBUG"
CXXDEBUGFLAGS="-g"
LDXX="$CXX"
LDFLAGS="-Wl,-twolevel_namespace -undefined error -arch x86_64 -mmacosx-version-min=$SDKVER -Wl,-syslibroot,$ISYSROOT -framework Cocoa $LDBUNDLE $LINKEXPORT"
LDBUNDLE="-bundle "
LINKEXPORT="-Wl,-exported_symbols_list,&quot;$MATLABROOT/extern/lib/maci64/mexFunction.map&quot;"
LINKLIBS="-L&quot;$MATLABROOT/bin/maci64&quot; -lmx -lmex -lmat"
LDOPTIMFLAGS="-O"
LDDEBUGFLAGS="-g"
OBJEXT=".o"
LDEXT=".mexmaci64"
/>
<client>
<engine
LINKLIBS="$LINKLIBS -leng"
LDBUNDLE=""
LINKEXPORT=""
LDEXT=""
/>
<mbuild
CMDLINE150="$MATLABROOT/bin/maci64/macbundle $EXENAME &quot;$EXEDIR&quot;"
CMDLINE200="$LDXX $LDFLAGS $OBJS $LINKOPTIM $LINKEXPORT $CXXLIBS $LINKLIBS -o &quot;$EXEDIR$EXENAME.app/Contents/MacOS/$EXENAME&quot;"
CXXFLAGS="-fexceptions -fno-common -arch x86_64 -mmacosx-version-min=$SDKVER -isysroot $ISYSROOT"
DEFINES="-DUNIX -DX11 -DMACI64"
LDFLAGS="-arch x86_64 -mmacosx-version-min=$SDKVER -Wl,-syslibroot,$ISYSROOT $LDTYPE $LINKEXPORT -framework CoreFoundation -bind_at_load"
LINKLIBS="-L&quot;$MATLABROOT/runtime/maci64&quot; -lmwmclmcrrt"
INCLUDE="-I&quot;$MATLABROOT/extern/include&quot; -I&quot;$MATLABROOT/extern/include/cpp&quot;"
MATLABMEX=""
LDEXT=""
LINKEXPORT=""
LDTYPE=""
/>
</client>
<locationFinder>
<!--Check for faulty DEVELOPER_DIR environment variable -->
<DEVELOPER_DIR_CHECK>
<or>
<not>
<envVarExists name="DEVELOPER_DIR" />
</not>
<dirExists name="$$" diagnostic="The environment variable DEVELOPER_DIR indicates a folder that does not exist. Please correct or delete this variable before using MEX." />
</or>
</DEVELOPER_DIR_CHECK>
<!-- User needs to run "!sudo xcode-select -switch /Applications/Xcode.app/"
to configure xcrun. This creates the file /usr/share/xcode-select/xcode_dir_path -->
<XCODE_DIR>
<and diagnostic="Xcode appears to be installed, but it has not been configured. Run &quot;&lt;a href=&quot;matlab:system(['osascript -e ''do shell script ' char(34) 'xcode-select -switch /Applications/Xcode.app' char(34) ' with administrator privileges'''])&quot;&gt;osascript -e 'do shell script &quot;xcode-select -switch /Applications/Xcode.app&quot; with administrator privileges'&lt;/a&gt;&quot; to configure Xcode. You must be an administrator of this computer to complete this action." >
<cmdReturns name="xcode-select -print-path" />
<dirExists name="$$" />
</and>
</XCODE_DIR>
<XCRUN_DIR>
<and>
<cmdReturns name="which xcrun" />
<dirExists name="$$" />
</and>
</XCRUN_DIR>
<!-- User needs to agree to license of the version (or higher) that we support -->
<XCODE_AGREED_VERSION>
<and diagnostic="Xcode is installed, but its license has not been accepted. Run Xcode and accept its license agreement." >
<or>
<cmdReturns name="defaults read com.apple.dt.Xcode IDEXcodeVersionForAgreedToGMLicense"/>
<cmdReturns name="defaults read /Library/Preferences/com.apple.dt.Xcode IDEXcodeVersionForAgreedToGMLicense"/>
</or>
<cmdReturns name="&#10;agreed=$$ &#10; if echo $agreed | grep -E '[\.\&quot;]' >/dev/null; then &#10; lhs=`expr &quot;$agreed&quot; : '\([0-9]*\)[\.].*'` &#10; rhs=`expr &quot;$agreed&quot; : '[0-9]*[\.]\(.*\)$'` &#10; if echo $rhs | grep -E '[\.&quot;]' >/dev/null; then &#10; rhs=`expr &quot;$rhs&quot; : '\([0-9]*\)[\.].*'` &#10; fi &#10; if [ $lhs -gt 4 ] || ( [ $lhs -eq 4 ] &amp;&amp; [ $rhs -ge 3 ] ); then &#10; echo $agreed &#10; else &#10; exit 1&#10; fi &#10; fi" />
</and>
</XCODE_AGREED_VERSION>
<ISYSROOT>
<and>
<cmdReturns name="xcode-select -print-path"/>
<or>
<dirExists name="$$/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk" />
<dirExists name="$$/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk" />
<dirExists name="$$/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk" />
<dirExists name="$$/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk" />
<dirExists name="$$/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk" />
<cmdReturns name="find $$ -name MacOSX10.7.sdk" />
<cmdReturns name="find $$ -name MacOSX10.8.sdk" />
<cmdReturns name="find $$ -name MacOSX10.9.sdk" />
<cmdReturns name="find $$ -name MacOSX10.10.sdk" />
<cmdReturns name="find $$ -name MacOSX10.11.sdk" />
</or>
</and>
</ISYSROOT>
<SDKVER>
<and>
<and>
<cmdReturns name="xcode-select -print-path"/>
<or>
<dirExists name="$$/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk" />
<dirExists name="$$/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk" />
<dirExists name="$$/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk" />
<dirExists name="$$/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk" />
<dirExists name="$$/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk" />
<cmdReturns name="find $$ -name MacOSX10.7.sdk" />
<cmdReturns name="find $$ -name MacOSX10.8.sdk" />
<cmdReturns name="find $$ -name MacOSX10.9.sdk" />
<cmdReturns name="find $$ -name MacOSX10.10.sdk" />
<cmdReturns name="find $$ -name MacOSX10.11.sdk" />
</or>
</and>
<cmdReturns name="echo $$ | rev | cut -c1-10 | rev | egrep -oh '[0-9]+\.[0-9]+'" />
</and>
</SDKVER>
</locationFinder>
</config>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment