aboutsummaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
authorMark Naughton <mark@marknaughton.com>2023-04-05 11:09:31 +0100
committerMark Naughton <mark@marknaughton.com>2023-04-05 11:09:31 +0100
commit5fc54ec7e57af02af38e6f979929d4542cadbfcf (patch)
tree9866833229d79201dda99a9447026c6021ba5663 /misc
parentfb0b9de7a952615b16383c1920a7291b2215f685 (diff)
Add script for removing platform-specific libs
Diffstat (limited to 'misc')
-rwxr-xr-xmisc/remove_libraries_for_other_platforms.sh46
1 files changed, 46 insertions, 0 deletions
diff --git a/misc/remove_libraries_for_other_platforms.sh b/misc/remove_libraries_for_other_platforms.sh
new file mode 100755
index 000000000..5a5286faf
--- /dev/null
+++ b/misc/remove_libraries_for_other_platforms.sh
@@ -0,0 +1,46 @@
+#!/bin/bash
+OS=$(uname)
+
+panic() {
+ printf "%s\n" "$1"
+ exit 1
+}
+
+remove_windows_libraries() {
+ find . -type f -name '*.dll' | xargs rm -f
+ find . -type f -name '*.lib' | xargs rm -f
+ find . -type d -name 'windows' | xargs rm -rf
+}
+
+remove_macos_libraries() {
+ find . -type f -name '*.dylib' | xargs rm -f
+ find . -type d -name '*macos*' | xargs rm -rf
+}
+
+remove_linux_libraries() {
+ find . -type f -name '*.so' | xargs rm -f
+ find . -type d -name 'linux' | xargs rm -rf
+}
+
+case $OS in
+ Linux)
+ remove_windows_libraries
+ remove_macos_libraries
+ ;;
+ Darwin)
+ remove_windows_libraries
+ remove_linux_libraries
+ ;;
+ OpenBSD)
+ remove_windows_libraries
+ remove_macos_libraries
+ remove_linux_libraries
+ ;;
+ FreeBSD)
+ remove_windows_libraries
+ remove_macos_libraries
+ remove_linux_libraries
+ ;;
+*)
+ panic "Platform unsupported!"
+esac