Changeset 162545 in webkit
- Timestamp:
- Jan 22, 2014 11:55:57 AM (10 years ago)
- Location:
- trunk/Tools
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r162538 r162545 1 2014-01-15 Martin Robinson <mrobinson@igalia.com> 2 3 [GTK][CMake] build-webkit should try harder to avoid re-running cmake 4 https://bugs.webkit.org/show_bug.cgi?id=127073 5 6 Reviewed by Daniel Bates. 7 8 * Scripts/build-webkit: Unify all the ports that call buildCMakeProjectOrExit with 9 the new isCMakeBuild conditional. This allows us to share more code between ports. 10 Pass the build arguments to the removeCMakeCache function. 11 * Scripts/webkitdirs.pm: 12 (runAutogenForAutotoolsProjectIfNecessary): Renamed mustReRunAutogen to cachedArgumentFileOutOfDate 13 because it's now shared with the CMake build. 14 (cachedArgumentFileOutOfDate): Renamed. 15 (cmakeCachePath): Added this helper which gets the CMakeCache.txt path. 16 (shouldRemoveCMakeCache): Tries to preserve current behavior for all ports, 17 except GTK+ which examines the OptionsGTK.cmake and OptionsCommon.cmake file 18 as well as checking if build-webkit has been run with different arguments. 19 (removeCMakeCache): Call shouldRemoveCMakeCache now. 20 (generateBuildSystemFromCMakeProject): Exit early if CMakeCache.txt exists for GTK+. 21 (isCMakeBuild): Added. 22 1 23 2014-01-22 Thiago de Barros Lacerda <thiago.lacerda@openbossa.org> 2 24 -
trunk/Tools/Scripts/build-webkit
r162512 r162545 253 253 } 254 254 255 if (isEfl() || isGtkCMake()) { 256 # By default we build using all of the available CPUs. 257 $makeArgs .= ($makeArgs ? " " : "") . "-j" . numberOfCPUs() if $makeArgs !~ /-j\s*\d+/; 255 if (isCMakeBuild()) { 258 256 $cmakeArgs = "-DENABLE_WEBKIT=OFF " . $cmakeArgs if $noWebKit1; 259 257 $cmakeArgs = "-DENABLE_WEBKIT2=OFF " . $cmakeArgs if $noWebKit2; 260 258 259 # By default we build using all of the available CPUs. 260 if (!isWinCE()) { 261 $makeArgs .= ($makeArgs ? " " : "") . "-j" . numberOfCPUs() if $makeArgs !~ /-j\s*\d+/; 262 } 263 261 264 # We remove CMakeCache to avoid the bots to reuse cached flags when 262 265 # we enable new features. This forces a reconfiguration. 263 removeCMakeCache(); 264 265 my $portName = (isEfl() ? "Efl" : "GTK"); 266 buildCMakeProjectOrExit($clean, $portName, $prefixPath, $makeArgs, (cmakeBasedPortArguments(), cMakeArgsFromFeatures()), $cmakeArgs); 267 } 268 269 if (isWinCE()) { 270 buildCMakeProjectOrExit($clean, "WinCE", $prefixPath, $makeArgs, (cmakeBasedPortArguments(), cMakeArgsFromFeatures()), $cmakeArgs); 266 my @featureArgs = cMakeArgsFromFeatures(); 267 removeCMakeCache(@featureArgs); 268 269 buildCMakeProjectOrExit($clean, cmakeBasedPortName(), $prefixPath, $makeArgs, (cmakeBasedPortArguments(), @featureArgs), $cmakeArgs); 271 270 } 272 271 -
trunk/Tools/Scripts/webkitdirs.pm
r162512 r162545 1661 1661 1662 1662 # Run autogen.sh again if either the features overrided by build-webkit or build arguments have changed. 1663 if (! mustReRunAutogen($sourceDir,"WebKitFeatureOverrides.txt", $joinedOverridableFeatures)1664 && ! mustReRunAutogen($sourceDir,"previous-autogen-arguments.txt", $joinedBuildArgs)) {1663 if (!isCachedArgumentfileOutOfDate("WebKitFeatureOverrides.txt", $joinedOverridableFeatures) 1664 && !isCachedArgumentfileOutOfDate("previous-autogen-arguments.txt", $joinedBuildArgs)) { 1665 1665 return; 1666 1666 } … … 1712 1712 } 1713 1713 1714 sub mustReRunAutogen($@)1715 { 1716 my ($ sourceDir, $filename, $currentContents) = @_;1714 sub isCachedArgumentfileOutOfDate($@) 1715 { 1716 my ($filename, $currentContents) = @_; 1717 1717 1718 1718 if (! -e $filename) { … … 1724 1724 close(CONTENTS_FILE); 1725 1725 1726 # We only care about the WebKit2 argument when we are building WebKit itself.1727 # build-jsc never passes --enable-webkit2, so if we didn't do this, autogen.sh1728 # would run for every single build on the bots, since it runs both build-webkit1729 # and build-jsc.1730 1726 if ($previousContents ne $currentContents) { 1731 1727 print "Contents for file $filename have changed.\n"; … … 1874 1870 } 1875 1871 1876 sub removeCMakeCache() 1877 { 1878 my $cacheFilePath = File::Spec->catdir(baseProductDir(), configuration(), "CMakeCache.txt"); 1879 unlink($cacheFilePath) if -e $cacheFilePath; 1872 sub cmakeCachePath() 1873 { 1874 return File::Spec->catdir(baseProductDir(), configuration(), "CMakeCache.txt"); 1875 } 1876 1877 sub shouldRemoveCMakeCache(@) 1878 { 1879 my ($cacheFilePath, @buildArgs) = @_; 1880 if (isWinCE()) { 1881 return 0; 1882 } 1883 1884 if (!isGtk()) { 1885 return 1; 1886 } 1887 1888 # We check this first, because we always want to create this file for a fresh build. 1889 my $optionsCache = File::Spec->catdir(baseProductDir(), configuration(), "build-webkit-options.txt"); 1890 my $joinedBuildArgs = join(" ", @buildArgs); 1891 if (isCachedArgumentfileOutOfDate($optionsCache, $joinedBuildArgs)) { 1892 open(CACHED_ARGUMENTS, ">", $optionsCache); 1893 print CACHED_ARGUMENTS $joinedBuildArgs; 1894 close(CACHED_ARGUMENTS); 1895 1896 return 1; 1897 } 1898 1899 my $cmakeCache = cmakeCachePath(); 1900 unless (-e $cmakeCache) { 1901 return 0; 1902 } 1903 1904 my $cacheFileModifiedTime = stat($cmakeCache)->mtime; 1905 my $platformConfiguration = File::Spec->catdir(sourceDir(), "Source", "cmake", "Options" . cmakeBasedPortName() . ".cmake"); 1906 if ($cacheFileModifiedTime < stat($platformConfiguration)->mtime) { 1907 return 1; 1908 } 1909 1910 my $globalConfiguration = File::Spec->catdir(sourceDir(), "Source", "cmake", "OptionsCommon.cmake"); 1911 if ($cacheFileModifiedTime < stat($globalConfiguration)->mtime) { 1912 return 1; 1913 } 1914 1915 return 0; 1916 } 1917 1918 sub removeCMakeCache(@) 1919 { 1920 my (@buildArgs) = @_; 1921 if (shouldRemoveCMakeCache(@buildArgs)) { 1922 my $cmakeCache = cmakeCachePath(); 1923 unlink($cmakeCache) if -e $cmakeCache; 1924 } 1880 1925 } 1881 1926 … … 1888 1933 my $originalWorkingDirectory = getcwd(); 1889 1934 chdir($buildPath) or die; 1935 1936 # For GTK+ we try to be smart about when to rerun cmake, so that we can have faster incremental builds. 1937 if (isGtk() && -e cmakeCachePath()) { 1938 return 0; 1939 } 1890 1940 1891 1941 my @args; … … 1979 2029 return "GTK" if isGtkCMake(); 1980 2030 return ""; 2031 } 2032 2033 sub isCMakeBuild() 2034 { 2035 return isEfl() || isWinCE() || isGtkCMake(); 1981 2036 } 1982 2037
Note: See TracChangeset
for help on using the changeset viewer.