Archived
1
0
Fork 0
This repository has been archived on 2024-08-12. You can view files and clone it, but cannot push or open issues or pull requests.
padavan-luna/extra_flags/wrapper.sh

18 lines
349 B
Bash
Raw Normal View History

2023-06-10 16:17:16 +02:00
#!/bin/sh
BIN=$(basename $0)
ROOT=$(dirname $(realpath $0))
ORIGINAL_BIN="${ROOT}/../bin_original/${BIN}"
COMPILER_FLAGS="-O3"
LINKER_FLAGS="-O3"
if [[ "$BIN" == *"c++"* || "$BIN" == *"g++"* || "$BIN" == *"gcc"* ]]
then
FLAGS="$COMPILER_FLAGS"
elif [[ "$BIN" == *"ld"* ]]
then
FLAGS="$LINKER_FLAGS"
fi
exec "${ORIGINAL_BIN}" "$@" $FLAGS