blob: 912982197c4c5b1b3046bd86d7b8b4709f3dc59d [file] [log] [blame]
# Copyright 2020 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("toolchain_runtime_deps.gni")
_toolchain_runtime_deps_cflags = []
# Note that we must add this first because runtime.json adds this flag first
# in the cflags lists. If we add this afterwards, then the comparison between
# config_flags and match_flags in toolchain_runtime_deps.gni will fail because
# this list will be out of order. We could technically just break down the
# comparison to do a set comparison of individual list variables in the scope,
# but this is much simpler.
if (use_cxx_relative_vtables) {
_toolchain_runtime_deps_cflags +=
[ "-fexperimental-relative-c++-abi-vtables" ]
}
if (toolchain_variant.tags + [ "asan" ] - [ "asan" ] !=
toolchain_variant.tags) {
_toolchain_runtime_deps_cflags += [ "-fsanitize=address" ]
} else if (toolchain_variant.tags + [ "ubsan" ] - [ "ubsan" ] !=
toolchain_variant.tags) {
_toolchain_runtime_deps_cflags += [ "-fsanitize=undefined" ]
}
toolchain_runtime_deps("static-libc++-deps") {
toolchain_spec = clang_toolchain_spec
cflags = _toolchain_runtime_deps_cflags
ldflags = [ "-static-libstdc++" ]
}
toolchain_runtime_deps("shared-libc++-deps") {
toolchain_spec = clang_toolchain_spec
cflags = _toolchain_runtime_deps_cflags
ldflags = []
}
toolchain_runtime_deps("static-rust-libstd-deps") {
toolchain_spec = rustc_toolchain_spec
rustflags = []
libraries = [ "libstd" ]
}
toolchain_runtime_deps("shared-rust-libstd-deps") {
toolchain_spec = rustc_toolchain_spec
rustflags = [ "-Cprefer-dynamic" ]
libraries = [ "libstd" ]
}
toolchain_runtime_deps("static-rust-libtest-deps") {
toolchain_spec = rustc_toolchain_spec
rustflags = []
libraries = [ "libtest" ]
}
toolchain_runtime_deps("shared-rust-libtest-deps") {
toolchain_spec = rustc_toolchain_spec
rustflags = [ "-Cprefer-dynamic" ]
libraries = [ "libtest" ]
}