diff options
author | Grzegorz Adam Hankiewicz <gradha@imap.cc> | 2012-09-07 10:14:09 +0200 |
---|---|---|
committer | Grzegorz Adam Hankiewicz <gradha@imap.cc> | 2012-09-08 22:41:17 +0200 |
commit | ca0c00134580b59c65a9eedea88f201bd125970e (patch) | |
tree | 8ece4a08e317c32214119434b71d65391682b005 /examples/cross_calculator/ios/scripts | |
parent | 116c54a8dd83c01a77d394f74bbe2372a8928cb8 (diff) | |
download | Nim-ca0c00134580b59c65a9eedea88f201bd125970e.tar.gz |
Adds iOS files for crossplatform calculator example.
Diffstat (limited to 'examples/cross_calculator/ios/scripts')
-rwxr-xr-x | examples/cross_calculator/ios/scripts/tags.sh | 13 | ||||
-rwxr-xr-x | examples/cross_calculator/ios/scripts/xcode_prebuild.sh | 36 |
2 files changed, 49 insertions, 0 deletions
diff --git a/examples/cross_calculator/ios/scripts/tags.sh b/examples/cross_calculator/ios/scripts/tags.sh new file mode 100755 index 000000000..111e7a1c0 --- /dev/null +++ b/examples/cross_calculator/ios/scripts/tags.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +if [ ! -d src ] +then + cd .. +fi + +if [ -d src ] +then + ~/bin/objctags -R \ + build/nimcache \ + src +fi diff --git a/examples/cross_calculator/ios/scripts/xcode_prebuild.sh b/examples/cross_calculator/ios/scripts/xcode_prebuild.sh new file mode 100755 index 000000000..7626ba0b9 --- /dev/null +++ b/examples/cross_calculator/ios/scripts/xcode_prebuild.sh @@ -0,0 +1,36 @@ +#!/bin/sh + +# Set this to the full path of your nimrod compiler +# since Xcode doesn't inherit your user environment. +PATH_TO_NIMROD=~/project/nimrod/bin/nimrod +# Set this to the location of the nimbase.h file so +# the script can update it if it changes. +PATH_TO_NIMBASE=~/project/nimrod/lib/nimbase.h + +# Force errors to fail script. +set -e + +# If we are running from inside the scripts subdir, get out. +if [ ! -d src ] +then + cd .. +fi + +DEST_NIMBASE=build/nimcache/nimbase.h + +# Ok, are we out now? +if [ -d src ] +then + # You may want to use a wildcard here to compile all nimrod files. + $PATH_TO_NIMROD objc --noMain --app:lib \ + --nimcache:build/nimcache --compileOnly \ + --header --cpu:i386 ../nimrod_backend/backend.nim + if [ "${PATH_TO_NIMBASE}" -nt "${DEST_NIMBASE}" ] + then + echo "Updating nimbase.h" + cp "${PATH_TO_NIMBASE}" "${DEST_NIMBASE}" + fi +else + echo "Uh oh, src directory not found?" + exit 1 +fi |