1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-07 21:17:07 +09:00
ladybird/Meta/find_compiler.sh
Timothy Flynn 3d0fdaacff Meta: Migrate find_compiler.sh logic to a python script
This will allow us to re-use this logic from within other python
scripts. The find_compiler.sh script still exists, as it is used by
some other bash scripts. The pick_host_compiler() function will now
execute find_compiler.py and store its result in $CC and $CXX.

Note that the python script supports Windows.
2025-05-29 16:24:17 -04:00

22 lines
433 B
Bash

# shellcheck shell=bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
pick_host_compiler() {
local output
local status
output=$("${DIR}/find_compiler.py")
status=$?
if [[ ${status} -ne 0 ]] ; then
exit ${status}
fi
if [[ "${output}" != *"CC="* || "${output}" != *"CXX="* ]] ; then
echo "Unexpected output from find_compiler.py"
exit 1
fi
eval "${output}"
}