1# Copyright (C) 2017 The Android Open Source Project 2# 3# Licensed under the Apache License, Version 2.0 (the "License"); 4# you may not use this file except in compliance with the License. 5# You may obtain a copy of the License at 6# 7# http://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an "AS IS" BASIS, 11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12# See the License for the specific language governing permissions and 13# limitations under the License. 14 15import("//gn/standalone/sanitizers/vars.gni") 16 17declare_args() { 18 is_hermetic_clang = is_clang && is_linux_host 19} 20 21assert(!is_hermetic_clang || is_clang, "is_hermetic_clang requires is_clang") 22 23declare_args() { 24 if (is_linux_host) { 25 if (is_hermetic_clang) { 26 _hermetic_llvm_dir = rebase_path("//buildtools/clang", root_build_dir) 27 linux_llvm_dir = "$_hermetic_llvm_dir/lib/clang/6.0.0/" 28 linux_clang_bin = "$_hermetic_llvm_dir/bin/clang" 29 linux_clangxx_bin = "$_hermetic_llvm_dir/bin/clang++" 30 linux_clangrt_dir = "$_hermetic_llvm_dir/lib/clang/6.0.0/lib/linux" 31 } else if (is_clang) { 32 # Guess the path for the system clang. 33 find_llvm_out = exec_script("linux_find_llvm.py", [], "list lines") 34 linux_llvm_dir = find_llvm_out[0] 35 linux_clang_bin = find_llvm_out[1] 36 linux_clangxx_bin = find_llvm_out[2] 37 linux_clangrt_dir = "$linux_llvm_dir/lib/linux" 38 } 39 } else if (is_mac) { 40 mac_toolchain_dirs_ = exec_script("mac_find_llvm.py", [], "list lines") 41 mac_toolchain_dir = mac_toolchain_dirs_[0] 42 mac_clangrt_dir = mac_toolchain_dirs_[1] 43 } 44} 45