balatro-gba/ci_scripts/check_gcc_version.sh
MeirGavish ae5369b8fe
Added C standard gnu23 to the makefile (#288)
* Added C standard gnu23 to the makefile

* Added gnu23 standard to all test modue makefiles

* Added installation of latest gcc version to tests workflow

* Fixed typo in previous commit

* Made GCC 14 installation conditional and moved from the workflow to the script

* Extracted GCC version check to external script for CI and created tests README

* Added #!/bin/bash

* Make check_gcc_version.sh executable
2025-12-12 18:46:03 -08:00

17 lines
550 B
Bash
Executable File

#!/bin/bash
# Check GCC version and install GCC 14 if needed
check_gcc_version() {
if command -v gcc &> /dev/null; then
gcc_version=$(gcc -dumpversion | cut -d. -f1)
if [ "$gcc_version" -lt 14 ]; then
echo "GCC version $gcc_version detected. Installing GCC 14..."
sudo apt-get update
sudo apt-get install -y gcc-14
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 100
echo "GCC 14 installed and set as default."
fi
fi
}
check_gcc_version