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
2023-06-10 17:17:16 +03:00

17 lines
349 B
Bash
Executable file

#!/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