Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / tools / clang / scripts / blink_gc_plugin_flags.sh
1 #!/usr/bin/env bash
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
4 # found in the LICENSE file.
5
6 # This script returns the flags that should be passed to clang.
7
8 THIS_ABS_DIR=$(cd $(dirname $0) && echo $PWD)
9 CLANG_LIB_PATH=$THIS_ABS_DIR/../../../third_party/llvm-build/Release+Asserts/lib
10
11 if uname -s | grep -q Darwin; then
12   LIBSUFFIX=dylib
13 else
14   LIBSUFFIX=so
15 fi
16
17 FLAGS=""
18 if [[ "$1" = "enable-oilpan=1" ]]; then
19     FLAGS="$FLAGS -Xclang -plugin-arg-blink-gc-plugin -Xclang enable-oilpan"
20 fi
21
22 echo -Xclang -load -Xclang $CLANG_LIB_PATH/libBlinkGCPlugin.$LIBSUFFIX \
23   -Xclang -add-plugin -Xclang blink-gc-plugin $FLAGS