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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 should_do_Release() { | 94 should_do_Release() { |
95 test "$BUILD_TYPE" = Release -o "$BUILD_TYPE" = Debug_and_Release | 95 test "$BUILD_TYPE" = Release -o "$BUILD_TYPE" = Debug_and_Release |
96 } | 96 } |
97 | 97 |
98 # Valid values: clang or gcc. | 98 # Valid values: clang or gcc. |
99 COMPILER=clang | 99 COMPILER=clang |
100 # Valid values: auto or disabled. | 100 # Valid values: auto or disabled. |
101 GOMA=auto | 101 GOMA=auto |
102 make_gn_args() { | 102 make_gn_args() { |
103 local args=() | 103 local args=() |
| 104 # TODO(vtl): It's a bit of a hack to infer the build type from the output |
| 105 # directory name, but it's what we have right now (since we support "debug and |
| 106 # release" mode). |
| 107 case "$1" in |
| 108 Debug) |
| 109 # (Default.) |
| 110 ;; |
| 111 Release) |
| 112 args+=("is_debug=false") |
| 113 ;; |
| 114 esac |
104 case "$COMPILER" in | 115 case "$COMPILER" in |
105 clang) | 116 clang) |
106 args+=("is_clang=true") | 117 # (Default.) |
107 ;; | 118 ;; |
108 gcc) | 119 gcc) |
109 args+=("is_clang=false") | 120 args+=("is_clang=false") |
110 ;; | 121 ;; |
111 esac | 122 esac |
112 case "$GOMA" in | 123 case "$GOMA" in |
113 auto) | 124 auto) |
114 if [ -v GOMA_DIR ]; then | 125 if [ -v GOMA_DIR ]; then |
115 args+=("use_goma=true" "goma_dir=\"${GOMA_DIR}\"") | 126 args+=("use_goma=true" "goma_dir=\"${GOMA_DIR}\"") |
116 elif [ -d "${HOME}/goma" ]; then | 127 elif [ -d "${HOME}/goma" ]; then |
117 args+=("use_goma=true" "goma_dir=\"${HOME}/goma\"") | 128 args+=("use_goma=true" "goma_dir=\"${HOME}/goma\"") |
118 else | 129 else |
119 args+=("use_goma=false") | 130 : # (Default.) |
120 fi | 131 fi |
121 ;; | 132 ;; |
122 disabled) | 133 disabled) |
123 args+=("use_goma=false") | 134 # (Default.) |
124 ;; | 135 ;; |
125 esac | 136 esac |
126 echo "${args[*]}" | 137 echo "${args[*]}" |
127 } | 138 } |
128 | 139 |
129 # We're in src/mojo/tools. We want to get to src. | 140 # We're in src/mojo/tools. We want to get to src. |
130 cd "$(realpath "$(dirname "$0")")/../.." | 141 cd "$(realpath "$(dirname "$0")")/../.." |
131 | 142 |
132 if [ $# -eq 0 ]; then | 143 if [ $# -eq 0 ]; then |
133 do_help | 144 do_help |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 GOMA=disabled | 207 GOMA=disabled |
197 ;; | 208 ;; |
198 *) | 209 *) |
199 echo "Unknown command \"${arg}\". Try \"$(basename "$0") help\"." | 210 echo "Unknown command \"${arg}\". Try \"$(basename "$0") help\"." |
200 exit 1 | 211 exit 1 |
201 ;; | 212 ;; |
202 esac | 213 esac |
203 done | 214 done |
204 | 215 |
205 exit 0 | 216 exit 0 |
OLD | NEW |