Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 70e8323a4fdd886403a1f5964cf393a677bc3796
https://github.com/WebKit/WebKit/commit/70e8323a4fdd886403a1f5964cf393a677bc3796
Author: Carlos Alberto Lopez Perez <[email protected]>
Date: 2026-08-19 (Wed, 19 Aug 2026)
Changed paths:
M Tools/Scripts/build-webkit
M Tools/Scripts/cross-toolchain-helper
M Tools/Scripts/webkitdirs.pm
M Tools/Scripts/webkitperl/BuildSubproject.pm
A
Tools/Scripts/webkitperl/webkitdirs_unittest/determineDefaultCompilerCMakeArgs.pl
A
Tools/Scripts/webkitperl/webkitdirs_unittest/determineDefaultCompilerClang.pl
A
Tools/Scripts/webkitperl/webkitdirs_unittest/determineDefaultCompilerCrossTarget.pl
A
Tools/Scripts/webkitperl/webkitdirs_unittest/determineDefaultCompilerNoClang.pl
M Tools/glib/dependencies/apt
M Tools/glib/dependencies/dnf
M Tools/glib/dependencies/pacman
M Tools/yocto/README.md
Log Message:
-----------
[GTK][WPE] Use Clang by default when building with build-webkit
https://bugs.webkit.org/show_bug.cgi?id=321142
Reviewed by Carlos Garcia Campos.
Until now the GTK and WPE ports were built with whatever compiler CMake
picked up by default, which on Linux means GCC. This makes build-webkit
and build-jsc use Clang instead for the GTK and WPE ports, and also for
JSCOnly when building on Linux.
This follows a recent change were we made Clang the default compiler on
the CI. So this aligns the default developer build with the CI for the
Linux ports. See 318539@main
The compiler is selected by exporting CC and CXX rather than by passing
-DCMAKE_C_COMPILER to CMake. The reason is that shouldRemoveCMakeCache()
already keeps track of CC and CXX, so a change on the compiler removes
the CMake cache and reconfigures the build directory. Note that this
means that the first build after this change will reconfigure and
rebuild any existing GTK, WPE or JSCOnly build directory.
Both the clang and the clang++ binaries have to be available in the
PATH. If any of them is missing then a warning is printed and the build
continues using the default system compiler, so this doesn't break
systems where Clang is not installed.
Clang is also the new default for the cross-builds done with the
toolchains generated by cross-toolchain-helper (the ones selected with
the --cross-target flag). Those toolchains ship both compilers, and the
environment setup script generated by cross-toolchain-helper already
checks the value of CC and CXX to decide which one of the two to use, so
in that case CC and CXX are set simply as a hint for that script and the
binaries from the host PATH are not checked (the compiler used is the
cross-compiled one from the toolchain). When the toolchain has no Clang
support the setup script keeps using GCC as before.
Anyone can still choose a different compiler: setting CC and CXX in the
environment or passing the compiler via --cmakeargs takes precedence over
the default.
* Tools/Scripts/build-webkit:
* Tools/Scripts/cross-toolchain-helper:
(YoctoCrossBuilder.cross_dev_shell):
* Tools/Scripts/webkitdirs.pm:
(determineDefaultCompiler):
(buildCMakeProjectOrExit):
* Tools/Scripts/webkitperl/BuildSubproject.pm:
*
Tools/Scripts/webkitperl/webkitdirs_unittest/determineDefaultCompilerCMakeArgs.pl:
Added.
*
Tools/Scripts/webkitperl/webkitdirs_unittest/determineDefaultCompilerClang.pl:
Added.
*
Tools/Scripts/webkitperl/webkitdirs_unittest/determineDefaultCompilerCrossTarget.pl:
Added.
*
Tools/Scripts/webkitperl/webkitdirs_unittest/determineDefaultCompilerNoClang.pl:
Added.
* Tools/glib/dependencies/apt:
* Tools/glib/dependencies/dnf:
* Tools/glib/dependencies/pacman:
* Tools/yocto/README.md:
Canonical link: https://commits.webkit.org/319452@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications