| OLD | NEW |
| 1 #!/bin/bash | 1 #!/bin/bash |
| 2 # Copyright 2013 The Chromium Authors. All rights reserved. | 2 # Copyright 2013 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 # This a simple script to make building/testing Mojo components easier (on | 6 # This a simple script to make building/testing Mojo components easier (on |
| 7 # Linux). | 7 # Linux). |
| 8 | 8 |
| 9 # TODO(vtl): Maybe make the test runner smart and not run unchanged test | 9 # TODO(vtl): Maybe make the test runner smart and not run unchanged test |
| 10 # binaries. | 10 # binaries. |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 Build/test options (specified before build/test/perftest): | 28 Build/test options (specified before build/test/perftest): |
| 29 --debug - Build/test in Debug mode. | 29 --debug - Build/test in Debug mode. |
| 30 --release - Build/test in Release mode. | 30 --release - Build/test in Release mode. |
| 31 --debug-and-release - Build/test in both Debug and Release modes (default). | 31 --debug-and-release - Build/test in both Debug and Release modes (default). |
| 32 Compiler options (specified before gyp): | 32 Compiler options (specified before gyp): |
| 33 --clang - Use clang (default). | 33 --clang - Use clang (default). |
| 34 --gcc - Use gcc. | 34 --gcc - Use gcc. |
| 35 Component options: | 35 Component options: |
| 36 --shared Build components as shared libraries (default). | 36 --shared Build components as shared libraries (default). |
| 37 --static Build components as static libraries. | 37 --static Build components as static libraries. |
| 38 Mojo in chromium/content (crbug.com/353602): |
| 39 --use-mojo - Enabled (default). |
| 40 --no-use-mojo - Disabled. |
| 38 | 41 |
| 39 Note: It will abort on the first failure (if any). | 42 Note: It will abort on the first failure (if any). |
| 40 EOF | 43 EOF |
| 41 } | 44 } |
| 42 | 45 |
| 43 do_build() { | 46 do_build() { |
| 44 echo "Building in out/$1 ..." | 47 echo "Building in out/$1 ..." |
| 45 ninja -C "out/$1" mojo || exit 1 | 48 ninja -C "out/$1" mojo || exit 1 |
| 46 } | 49 } |
| 47 | 50 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 test "$BUILD_TEST_TYPE" = Debug -o "$BUILD_TEST_TYPE" = Debug_and_Release | 83 test "$BUILD_TEST_TYPE" = Debug -o "$BUILD_TEST_TYPE" = Debug_and_Release |
| 81 } | 84 } |
| 82 should_do_Release() { | 85 should_do_Release() { |
| 83 test "$BUILD_TEST_TYPE" = Release -o "$BUILD_TEST_TYPE" = Debug_and_Release | 86 test "$BUILD_TEST_TYPE" = Release -o "$BUILD_TEST_TYPE" = Debug_and_Release |
| 84 } | 87 } |
| 85 | 88 |
| 86 # Valid values: clang or gcc. | 89 # Valid values: clang or gcc. |
| 87 COMPILER=clang | 90 COMPILER=clang |
| 88 # Valid values: shared or static. | 91 # Valid values: shared or static. |
| 89 COMPONENT=shared | 92 COMPONENT=shared |
| 93 # TODO(vtl): Remove this. crbug.com/353602 |
| 94 # Valid values: enabled or disabled. |
| 95 USE_MOJO=enabled |
| 90 make_gyp_defines() { | 96 make_gyp_defines() { |
| 91 local options=() | 97 local options=() |
| 92 # Always include these options. | 98 # Always include these options. |
| 93 options+=("use_aura=1") | 99 options+=("use_aura=1") |
| 94 case "$COMPILER" in | 100 case "$COMPILER" in |
| 95 clang) | 101 clang) |
| 96 options+=("clang=1") | 102 options+=("clang=1") |
| 97 ;; | 103 ;; |
| 98 gcc) | 104 gcc) |
| 99 options+=("clang=0") | 105 options+=("clang=0") |
| 100 ;; | 106 ;; |
| 101 esac | 107 esac |
| 102 case "$COMPONENT" in | 108 case "$COMPONENT" in |
| 103 shared) | 109 shared) |
| 104 options+=("component=shared_library") | 110 options+=("component=shared_library") |
| 105 ;; | 111 ;; |
| 106 static) | 112 static) |
| 107 options+=("component=static_library") | 113 options+=("component=static_library") |
| 108 ;; | 114 ;; |
| 109 esac | 115 esac |
| 116 case "$USE_MOJO" in |
| 117 enabled) |
| 118 options+=("use_mojo=1") |
| 119 ;; |
| 120 disabled) |
| 121 options+=("use_mojo=0") |
| 122 ;; |
| 123 esac |
| 110 echo ${options[*]} | 124 echo ${options[*]} |
| 111 } | 125 } |
| 112 | 126 |
| 113 # We're in src/mojo/tools. We want to get to src. | 127 # We're in src/mojo/tools. We want to get to src. |
| 114 cd "$(realpath "$(dirname "$0")")/../.." | 128 cd "$(realpath "$(dirname "$0")")/../.." |
| 115 | 129 |
| 116 if [ $# -eq 0 ]; then | 130 if [ $# -eq 0 ]; then |
| 117 do_help | 131 do_help |
| 118 exit 0 | 132 exit 0 |
| 119 fi | 133 fi |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 ;; | 181 ;; |
| 168 --gcc) | 182 --gcc) |
| 169 COMPILER=gcc | 183 COMPILER=gcc |
| 170 ;; | 184 ;; |
| 171 --shared) | 185 --shared) |
| 172 COMPONENT=shared | 186 COMPONENT=shared |
| 173 ;; | 187 ;; |
| 174 --static) | 188 --static) |
| 175 COMPONENT=static | 189 COMPONENT=static |
| 176 ;; | 190 ;; |
| 191 --use-mojo) |
| 192 USE_MOJO=enabled |
| 193 ;; |
| 194 --no-use-mojo) |
| 195 USE_MOJO=disabled |
| 196 ;; |
| 177 *) | 197 *) |
| 178 echo "Unknown command \"${arg}\". Try \"$(basename "$0") help\"." | 198 echo "Unknown command \"${arg}\". Try \"$(basename "$0") help\"." |
| 179 exit 1 | 199 exit 1 |
| 180 ;; | 200 ;; |
| 181 esac | 201 esac |
| 182 done | 202 done |
| OLD | NEW |