xref: /build/config/c++/c++.gni (revision 5f9996aa)
15f9996aaSopenharmony_ci# Copyright 2017 The Chromium Authors. All rights reserved.
25f9996aaSopenharmony_ci# Use of this source code is governed by a BSD-style license that can be
35f9996aaSopenharmony_ci# found in the LICENSE file.
45f9996aaSopenharmony_ci
55f9996aaSopenharmony_ciimport("//build/config/sanitizers/sanitizers.gni")
65f9996aaSopenharmony_ci
75f9996aaSopenharmony_cideclare_args() {
85f9996aaSopenharmony_ci  # Use libc++ (//third_party/libcxx)
95f9996aaSopenharmony_ci  use_custom_libcxx = false
105f9996aaSopenharmony_ci
115f9996aaSopenharmony_ci  use_custom_libcxx_for_host = false
125f9996aaSopenharmony_ci}
135f9996aaSopenharmony_ci
145f9996aaSopenharmony_ciuse_custom_libcxx =
155f9996aaSopenharmony_ci    use_custom_libcxx || (use_custom_libcxx_for_host && current_cpu == host_cpu)
165f9996aaSopenharmony_ciuse_custom_libcxx = use_custom_libcxx && !is_nacl
175f9996aaSopenharmony_ci
185f9996aaSopenharmony_ci# libc++abi needs to be exported from executables to be picked up by shared
195f9996aaSopenharmony_ci# libraries on certain instrumented builds.
205f9996aaSopenharmony_ciexport_libcxxabi_from_executables = use_custom_libcxx && !is_component_build &&
215f9996aaSopenharmony_ci                                    (is_asan || is_tsan || is_ubsan_vptr)
225f9996aaSopenharmony_ci
235f9996aaSopenharmony_cilibcxx_prefix = "//third_party/libcxx"
245f9996aaSopenharmony_cilibcxxabi_prefix = "//third_party/libcxxabi"
255f9996aaSopenharmony_ci
265f9996aaSopenharmony_ciif (is_double_framework) {
275f9996aaSopenharmony_ci  libcxx_prefix = "${asdk_libs_dir}/ndk/libcxx"
285f9996aaSopenharmony_ci  libcxxabi_prefix = "${asdk_libs_dir}/ndk/libcxxabi"
295f9996aaSopenharmony_ci}
30