mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 00:47:45 +00:00
Meta: Also set CC/CXX when selecting the host toolchain
This ensures that the toolchain building scripts will use the host toolchain that has been found manually, and that they won't fall back to `cc` (which in the worst case may not even be installed).
This commit is contained in:
parent
7ecc50db57
commit
40165a1c40
1 changed files with 7 additions and 6 deletions
|
@ -189,22 +189,20 @@ find_newest_compiler() {
|
||||||
|
|
||||||
pick_host_compiler() {
|
pick_host_compiler() {
|
||||||
if is_supported_compiler "$CC" && is_supported_compiler "$CXX"; then
|
if is_supported_compiler "$CC" && is_supported_compiler "$CXX"; then
|
||||||
CMAKE_ARGS+=("-DCMAKE_C_COMPILER=$CC")
|
|
||||||
CMAKE_ARGS+=("-DCMAKE_CXX_COMPILER=$CXX")
|
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
find_newest_compiler egcc gcc gcc-11 gcc-12 /usr/local/bin/gcc-11 /opt/homebrew/bin/gcc-11
|
find_newest_compiler egcc gcc gcc-11 gcc-12 /usr/local/bin/gcc-11 /opt/homebrew/bin/gcc-11
|
||||||
if is_supported_compiler "$HOST_COMPILER"; then
|
if is_supported_compiler "$HOST_COMPILER"; then
|
||||||
CMAKE_ARGS+=("-DCMAKE_C_COMPILER=$HOST_COMPILER")
|
export CC="${HOST_COMPILER}"
|
||||||
CMAKE_ARGS+=("-DCMAKE_CXX_COMPILER=${HOST_COMPILER/gcc/g++}")
|
export CXX="${HOST_COMPILER/gcc/g++}"
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
find_newest_compiler clang clang-13 clang-14 clang-15 /opt/homebrew/opt/llvm/bin/clang
|
find_newest_compiler clang clang-13 clang-14 clang-15 /opt/homebrew/opt/llvm/bin/clang
|
||||||
if is_supported_compiler "$HOST_COMPILER"; then
|
if is_supported_compiler "$HOST_COMPILER"; then
|
||||||
CMAKE_ARGS+=("-DCMAKE_C_COMPILER=$HOST_COMPILER")
|
export CC="${HOST_COMPILER}"
|
||||||
CMAKE_ARGS+=("-DCMAKE_CXX_COMPILER=${HOST_COMPILER/clang/clang++}")
|
export CXX="${HOST_COMPILER/clang/clang++}"
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -213,7 +211,10 @@ pick_host_compiler() {
|
||||||
|
|
||||||
cmd_with_target() {
|
cmd_with_target() {
|
||||||
is_valid_target || ( >&2 echo "Unknown target: $TARGET"; usage )
|
is_valid_target || ( >&2 echo "Unknown target: $TARGET"; usage )
|
||||||
|
|
||||||
pick_host_compiler
|
pick_host_compiler
|
||||||
|
CMAKE_ARGS+=("-DCMAKE_C_COMPILER=${CC}")
|
||||||
|
CMAKE_ARGS+=("-DCMAKE_CXX_COMPILER=${CXX}")
|
||||||
|
|
||||||
if [ ! -d "$SERENITY_SOURCE_DIR" ]; then
|
if [ ! -d "$SERENITY_SOURCE_DIR" ]; then
|
||||||
SERENITY_SOURCE_DIR="$(get_top_dir)"
|
SERENITY_SOURCE_DIR="$(get_top_dir)"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue