[Gtk] build.sh needs a -- before make options when the build command is cmake --build
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 25 Sep 2014 14:45:22 +0000 (14:45 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 25 Sep 2014 14:45:22 +0000 (14:45 +0000)
https://bugs.webkit.org/show_bug.cgi?id=136377

Patch by Carlos Garcia Campos <cgarcia@igalia.com> on 2014-09-25
Reviewed by Philippe Normand.

.:

* Source/cmake/OptionsGTK.cmake: Only create the build.sh script
for CMake versions less than 3.

Tools:

* Scripts/webkitdirs.pm:
(buildCMakeGeneratedProject): Only use the build.sh script if it exists.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@173964 268f45cc-cd09-0410-ab3c-d52691b4dbfc

ChangeLog
Source/cmake/OptionsGTK.cmake
Tools/ChangeLog
Tools/Scripts/webkitdirs.pm

index 2078069..43873c0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2014-09-25  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        [Gtk] build.sh needs a -- before make options when the build command is cmake --build
+        https://bugs.webkit.org/show_bug.cgi?id=136377
+
+        Reviewed by Philippe Normand.
+
+        * Source/cmake/OptionsGTK.cmake: Only create the build.sh script
+        for CMake versions less than 3.
+
 2014-09-25  Csaba Osztrogon√°c  <ossy@webkit.org>
 
         Remove WinCE port from trunk
index 0afc503..11912b6 100644 (file)
@@ -362,20 +362,26 @@ macro(ADD_WHOLE_ARCHIVE_TO_LIBRARIES _list_name)
     set(${_list_name} "${${_list_name}_TMP}")
 endmacro()
 
-build_command(COMMAND_LINE_TO_BUILD)
-# build_command unconditionally adds -i (ignore errors) for make, and there's
-# no reasonable way to turn that off, so we just replace it with -k, which has
-# the same effect, except that the return code will indicate that an error occurred.
-# See: http://www.cmake.org/cmake/help/v3.0/command/build_command.html
-string(REPLACE " -i" " -k" COMMAND_LINE_TO_BUILD ${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)
+if (CMAKE_MAJOR_VERSION LESS 3)
+    # Before CMake 3 it was necessary to use a build script instead of using cmake --build directly
+    # to preserve colors and pretty-printing.
+
+    build_command(COMMAND_LINE_TO_BUILD)
+    # build_command unconditionally adds -i (ignore errors) for make, and there's
+    # no reasonable way to turn that off, so we just replace it with -k, which has
+    # the same effect, except that the return code will indicate that an error occurred.
+    # See: http://www.cmake.org/cmake/help/v3.0/command/build_command.html
+    string(REPLACE " -i" " -k" COMMAND_LINE_TO_BUILD ${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
+    )
+endif ()
 
 if (ENABLE_SUBTLE_CRYPTO)
     find_package(GnuTLS 3.0.0 REQUIRED)
index 29d7ceb..5516a78 100644 (file)
@@ -1,3 +1,13 @@
+2014-09-25  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        [Gtk] build.sh needs a -- before make options when the build command is cmake --build
+        https://bugs.webkit.org/show_bug.cgi?id=136377
+
+        Reviewed by Philippe Normand.
+
+        * Scripts/webkitdirs.pm:
+        (buildCMakeGeneratedProject): Only use the build.sh script if it exists.
+
 2014-09-25  Akos Kiss  <akiss@inf.u-szeged.hu>
 
         [EFL] Split the list of dependencies to make sure that at least the universally available packages get installed
index 28b4d62..772dcc4 100755 (executable)
@@ -1823,8 +1823,8 @@ sub buildCMakeGeneratedProject($)
     my @args = ("--build", $buildPath, "--config", $config);
     push @args, ("--", $makeArgs) if $makeArgs;
 
-    # GTK uses a build script to preserve colors and pretty-printing.
-    if (isGtk()) {
+    # GTK can use a build script to preserve colors and pretty-printing.
+    if (isGtk() && -e "$buildPath/build.sh") {
         chdir "$buildPath" or die;
         $command = "$buildPath/build.sh";
         @args = ($makeArgs);