aboutsummaryrefslogtreecommitdiffhomepage
path: root/build_tools
diff options
context:
space:
mode:
Diffstat (limited to 'build_tools')
-rwxr-xr-xbuild_tools/xcode_version_gen.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/build_tools/xcode_version_gen.sh b/build_tools/xcode_version_gen.sh
new file mode 100755
index 00000000..5bc26145
--- /dev/null
+++ b/build_tools/xcode_version_gen.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+# Expects to be called from Xcode (Run Script build phase),
+# write version number C preprocessor macro to header file.
+
+tmp="$SCRIPT_OUTPUT_FILE_1"
+ver="$SCRIPT_OUTPUT_FILE_0"
+
+./build_tools/git_version_gen.sh
+
+cat FISH-BUILD-VERSION-FILE | awk '{printf("#define %s \"%s\"\n",$1,$3)}' > "$tmp"
+
+cmp --quiet "$tmp" "$ver"
+if [ $? -ne 0 ]; then
+ /bin/mv "$tmp" "$ver"
+else
+ /bin/rm "$tmp"
+fi