Skip to content

Commit

Permalink
Merge 165473 - [GTK][CMAKE] Too verbose build output
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=130076

Reviewed by Carlos Garcia Campos.

.:

* Source/cmake/OptionsGTK.cmake: Generate a script which does the actual build. This
works around an issue where cmake --build doesn't support ninja's pretty printing.

Tools:

Instead of building with cmake --build which isn't smart about pretty printing and
colors, we build with a script which calls the proper build command.

* Scripts/webkitdirs.pm:
(buildCMakeGeneratedProject): For GTK+ call the script that we generate during
the CMake configuration pass.


Conflicts:
	ChangeLog
	Tools/ChangeLog
  • Loading branch information
kov committed May 13, 2014
1 parent fbf0281 commit 24e3a94
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
10 changes: 10 additions & 0 deletions Source/cmake/OptionsGTK.cmake
Expand Up @@ -298,3 +298,13 @@ macro(ADD_WHOLE_ARCHIVE_TO_LIBRARIES _list_name)
endforeach ()
set(${_list_name} "${${_list_name}_TMP}")
endmacro()

build_command(COMMAND_LINE_TO_BUILD)
file(WRITE
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/build.sh
"#!/bin/sh\n"
"${COMMAND_LINE_TO_BUILD} $@"
)
file(COPY ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/build.sh
DESTINATION ${CMAKE_BINARY_DIR}
FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE)
12 changes: 11 additions & 1 deletion Tools/Scripts/webkitdirs.pm
Expand Up @@ -2018,13 +2018,23 @@ sub buildCMakeGeneratedProject($)
if (! -d $buildPath) {
die "Must call generateBuildSystemFromCMakeProject() before building CMake project.";
}

my $command = "cmake";
my @args = ("--build", $buildPath, "--config", $config);
push @args, ("--", $makeArgs) if $makeArgs;

# GTK uses a build script to preserve colors and pretty-printing.
if (isGtk()) {
chdir "$buildPath" or die;
$command = "$buildPath/build.sh";
@args = ($makeArgs);
}

# We call system("cmake @args") instead of system("cmake", @args) so that @args is
# parsed for shell metacharacters. In particular, $makeArgs may contain such metacharacters.
my $wrapper = join(" ", jhbuildWrapperPrefixIfNeeded()) . " ";
return system($wrapper . "cmake @args");
return system($wrapper . "$command @args");

}

sub cleanCMakeGeneratedProject()
Expand Down

0 comments on commit 24e3a94

Please sign in to comment.