mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-08 05:27:14 +09:00

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.
22 lines
433 B
Bash
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}"
|
|
}
|