OLD | NEW |
1 #!/usr/bin/env bash | 1 #!/usr/bin/env bash |
2 # Copyright 2014 The Chromium Authors. All rights reserved. | 2 # Copyright 2014 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 script returns the flags that should be passed to clang. | 6 # This script returns the flags that should be passed to clang. |
7 | 7 |
8 THIS_ABS_DIR=$(cd $(dirname $0) && echo $PWD) | 8 THIS_ABS_DIR=$(cd $(dirname $0) && echo $PWD) |
9 CLANG_LIB_PATH=$THIS_ABS_DIR/../../../third_party/llvm-build/Release+Asserts/lib | 9 CLANG_LIB_PATH=$THIS_ABS_DIR/../../../third_party/llvm-build/Release+Asserts/lib |
10 | 10 |
11 if uname -s | grep -q Darwin; then | 11 if uname -s | grep -q Darwin; then |
12 LIBSUFFIX=dylib | 12 LIBSUFFIX=dylib |
13 else | 13 else |
14 LIBSUFFIX=so | 14 LIBSUFFIX=so |
15 fi | 15 fi |
16 | |
17 LIBNAME=\ | 16 LIBNAME=\ |
18 $(grep LIBRARYNAME "$THIS_ABS_DIR"/../blink_gc_plugin/Makefile \ | 17 $(grep 'set( LIBRARYNAME' "$THIS_ABS_DIR"/../blink_gc_plugin/CMakeLists.txt \ |
19 | cut -d ' ' -f 3) | 18 | cut -d ' ' -f 3) |
20 | 19 |
21 FLAGS="" | 20 FLAGS="" |
22 for arg in "$@"; do | 21 for arg in "$@"; do |
23 if [[ "$arg" = "enable-oilpan=1" ]]; then | 22 if [[ "$arg" = "enable-oilpan=1" ]]; then |
24 FLAGS="$FLAGS -Xclang -plugin-arg-blink-gc-plugin -Xclang enable-oilpan" | 23 FLAGS="$FLAGS -Xclang -plugin-arg-blink-gc-plugin -Xclang enable-oilpan" |
25 elif [[ "$arg" = "dump-graph=1" ]]; then | 24 elif [[ "$arg" = "dump-graph=1" ]]; then |
26 FLAGS="$FLAGS -Xclang -plugin-arg-blink-gc-plugin -Xclang dump-graph" | 25 FLAGS="$FLAGS -Xclang -plugin-arg-blink-gc-plugin -Xclang dump-graph" |
27 fi | 26 fi |
28 done | 27 done |
29 | 28 |
30 echo -Xclang -load -Xclang $CLANG_LIB_PATH/lib$LIBNAME.$LIBSUFFIX \ | 29 echo -Xclang -load -Xclang $CLANG_LIB_PATH/lib$LIBNAME.$LIBSUFFIX \ |
31 -Xclang -add-plugin -Xclang blink-gc-plugin $FLAGS | 30 -Xclang -add-plugin -Xclang blink-gc-plugin $FLAGS |
OLD | NEW |