# Copyright (C) 2017 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import("//gn/perfetto_check_build_deps.gni")
import("//gn/standalone/android.gni")
import("//gn/standalone/libc++/libc++.gni")
import("//gn/standalone/sanitizers/sanitizers.gni")
import("//gn/standalone/toolchain/msvc.gni")
import("//gn/standalone/wasm.gni")

# These warnings have been introduced with the newest version of clang (only in
# the hermetic build) and are enabled just with -Werror.
hermetic_clang_suppressions = [ "-Wno-c99-designator" ]

# We deal with three toolchains here:
# 1. Clang, used in most cases.
# 2. GCC, used in some Linux cases.
# 3. MSVC, used in some Windows cases.
# Clang vs gcc is typically not a problem: both support roughly the same
# switches. -Wno-unknown-warning-option fixes the mismatching ones.
# The situation on Windows is a bit trickier: clang-cl.exe really pretends to be
# cl.exe (MSVC), so we should use MSVC-style switches (e.g. /W2). However,
# clang-cl.exe still supports some -Wclang-style-switches for flags that don't
# have a corresponding version in MSVC.
#
# In the rules below, the conditionals should be interpreted as follows:
# is_win -> can be either clang-cl.exe or cl.exe (MSVC). Only MSVC-style
#           switches (the common denominator) should be used.
# is_clang -> could be clang-on-linux, clang-on-mac or clang-cl.exe.

config("extra_warnings") {
  if (is_win) {
    cflags = [
      "/W2",
      "/wd4244",  # conversion from 'float' to 'int', possible loss of data
      "/wd4267",  # conversion from 'size_t' to 'int', possible loss of data
    ]
    if (is_clang) {
      cflags += [
        "-Wno-float-equal",
        "-Wno-unused-macros",
        "-Wno-old-style-cast",
      ]
    }
  } else {
    # Clang or Gcc. On linux, Android and Mac.
    cflags = [
      "-Wall",
      "-Wextra",
      "-Wpedantic",
    ]
  }

  # Disable variadic macro warning as we make extensive use of them in trace
  # processor and client API.
  if (is_clang) {
    if (!is_fuzzer) {
      # Disable Weverything on fuzzers to avoid breakages when new versions of
      # clang are rolled into OSS-fuzz.
      cflags += [ "-Weverything" ]
    }
    cflags += [
      "-Wno-c++98-compat-pedantic",
      "-Wno-c++98-compat",
      "-Wno-disabled-macro-expansion",
      "-Wno-documentation-unknown-command",
      "-Wno-gnu-include-next",
      "-Wno-gnu-statement-expression",
      "-Wno-gnu-zero-variadic-macro-arguments",
      "-Wno-padded",
      "-Wno-poison-system-directories",
      "-Wno-reserved-id-macro",
      "-Wno-reserved-identifier",
      "-Wno-shadow-uncaptured-local",
      "-Wno-unknown-sanitizers",
      "-Wno-unknown-warning-option",
      "-Wno-unsafe-buffer-usage",
    ]
  } else if (!is_clang && !is_win) {
    # Use return std::move(...) for compatibility with old GCC compilers.
    cflags_cc = [ "-Wno-redundant-move" ]

    # Use after free detection in GCC is still not good enough: it still fails
    # on very obvious false-positives in trace processor.
    cflags_cc += [ "-Wno-use-after-free" ]

    # GCC 7's handling of uninitialized std::optional is flaky at best and
    # causes many false positives.
    # TODO(lalitm): remove this when we upgrade to a GCC version which is good
    # enough to handle this.
    cflags_cc += [ "-Wno-maybe-uninitialized" ]

    # GCC's handling of detecting infinite recursion is flaky at best and
    # causes some false positives.
    # TODO(lalitm): remove this when we upgrade to a GCC version which is good
    # enough to handle this.
    cflags_cc += [ "-Wno-infinite-recursion" ]

    # GCC's handling of detecting non null arguments is flaky at best and
    # causes some false positives.
    # TODO(lalitm): remove this when we upgrade to a GCC version which is good
    # enough to handle this.
    cflags_cc += [ "-Wno-nonnull" ]
  }
}

config("no_exceptions") {
  # Exceptions are disabled by default on Windows (Use /EHsc to enable them).
  if (!is_win) {
    cflags_cc = [ "-fno-exceptions" ]
  }
}

config("no_rtti") {
  if (is_win) {
    cflags_cc = [ "/GR-" ]
  } else {
    cflags_cc = [ "-fno-rtti" ]
  }
}

# Used in buildtools dependencies for standalone builds.
config("c++17") {
  if (is_win) {
    cflags_cc = [ "/std:c++17" ]
  } else {
    cflags_cc = [ "-std=c++17" ]
  }
}

# Used in buildtools dependencies for standalone builds.
config("c++20") {
  visibility = [ "//buildtools:libc++config" ]
  if (is_win) {
    cflags_cc = [ "/std:c++20" ]
  } else {
    cflags_cc = [ "-std=c++20" ]
  }
}

config("visibility_hidden") {
  if (!is_win) {
    cflags = [ "-fvisibility=hidden" ]
  }
}

config("win32_lean_and_mean") {
  if (is_win) {
    defines = [ "WIN32_LEAN_AND_MEAN" ]
  }
}

config("default") {
  asmflags = []
  cflags = []
  cflags_c = []
  cflags_cc = []
  defines = []
  include_dirs = []
  ldflags = []
  libs = []

  if ((is_android || is_linux) && !is_wasm) {
    ldflags += [ "-Wl,--build-id" ]
  }

  if (is_clang || !is_win) {  # Clang or GCC, but not MSVC.
    cflags += [
      "-fstrict-aliasing",
      "-Wformat",
    ]
  }

  if (is_clang && is_win) {
    # clang-cl from version 16 does not like out-of-line definition of static
    # constexpr, even in C++14 mode. Disable the deprecated warnings to work
    # around the problem.
    cflags += [ "-Wno-deprecated" ]
  }

  if (is_win) {
    cflags += [
      "/bigobj",  # Some of our files are bigger than the regular limits.
      "/Gy",  # Enable function-level linking.
      "/FS",  # Preserve previous PDB behavior.
      "/utf-8",  # Assume UTF-8 by default to avoid code page dependencies.
      "/Zc:__cplusplus",  # Allow use of __cplusplus macro.
    ]
    defines += [
      "_CRT_NONSTDC_NO_WARNINGS",
      "_CRT_SECURE_NO_DEPRECATE",
      "_CRT_SECURE_NO_WARNINGS",  # Disables warnings on some POSIX-compat API.
      "_SCL_SECURE_NO_DEPRECATE",
      "NOMINMAX",
    ]
    if (!use_custom_libcxx) {
      defines += [ "_HAS_EXCEPTIONS=0" ]  # Disables exceptions in MSVC STL.
    }
  } else if (!is_wasm) {  # !is_win
    cflags += [
      "-g",
      "-fPIC",
      "-fstack-protector-strong",
    ]
  }

  # Treat warnings as errors, but give up on fuzzer builds.
  if (!is_fuzzer) {
    if (is_win) {
      cflags += [ "/WX" ]
    } else {
      cflags += [ "-Werror" ]
    }
  }

  if (is_clang) {
    cflags += [ "-fcolor-diagnostics" ]
    if (!is_win) {
      cflags += [ "-fdiagnostics-show-template-tree" ]
    }
  }

  if (is_hermetic_clang && is_linux && !is_wasm) {
    cflags += hermetic_clang_suppressions
  } else {
    not_needed([ "hermetic_clang_suppressions" ])
  }

  if (non_hermetic_clang_stdlib != "") {
    if (is_clang && !is_hermetic_clang && !is_wasm) {
      cflags_cc += [ "-stdlib=" + non_hermetic_clang_stdlib ]
      ldflags += [ "-stdlib=" + non_hermetic_clang_stdlib ]
    }
  }

  if (is_lto) {
    cflags += [ "-flto=full" ]
    ldflags += [ "-flto=full" ]
  }

  if (is_win) {
    # We support only x86/x64 builds on Windows.
    assert(current_cpu == "x64" || current_cpu == "x86")
  } else if (current_cpu == "arm") {
    cflags += [
      "-march=armv7-a",
      "-mfpu=neon",
      "-mthumb",
    ]
  } else if (current_cpu == "x86") {
    asmflags += [ "-m32" ]
    cflags += [
      "-m32",
      "-msse2",
      "-mfpmath=sse",
    ]
    ldflags += [
      "-m32",
      "-lgcc",
    ]
  } else if (current_cpu == "arm64") {
    cflags += [ "-fno-omit-frame-pointer" ]
  } else if (current_cpu == "x64") {
    cflags += [ "-fno-omit-frame-pointer" ]  # For perf profiling.
    if (enable_perfetto_x64_cpu_opt) {
      # When updating these flags, the CheckCpuOptimizations() in utils.cc must
      # be updated accordingly.
      cflags += [
        "-mbmi",
        "-mbmi2",
        "-mavx2",
        "-mpopcnt",
        "-msse4.2",
      ]
    }
  }

  if (is_wasm) {
    # As of writing (2023-06-12) WASM 128bit SIMD is supported on
    # stable Chrome, Safari, and Firefox. See:
    # - https://webassembly.org/roadmap/
    # - https://emscripten.org/docs/porting/simd.html
    cflags += [ "-msimd128" ]
  }

  if (is_linux) {
    # Enable LFS (large file support) for stat() and other syscalls.
    cflags += [
      "-D_FILE_OFFSET_BITS=64",
      "-D_LARGEFILE_SOURCE",
      "-D_LARGEFILE64_SOURCE",
    ]
    libs += [
      "pthread",
      "rt",
    ]
  }

  if (is_win && !is_clang) {
    # When using MSVC we need to manually pass the include dirs. clang-cl.exe
    # doesn't need them because it's smart enough to figure out the right path
    # by querying the registry on its own.
    include_dirs = win_msvc_inc_dirs  # Defined in msvc.gni.
  }

  if (is_debug) {
    if (is_win) {
      cflags += [ "/Z7" ]
      if (is_clang) {
        # Required to see symbols in windbg when building with clang-cl.exe.
        cflags += [ "-gcodeview-ghash" ]
        ldflags = [ "/DEBUG:GHASH" ]
      }
    } else {
      libs += [ "dl" ]
    }
  }

  if (is_android) {
    asmflags += [ "--target=$android_abi_target" ]
    cflags += [
      "--sysroot=$android_compile_sysroot",
      "-DANDROID",
      "-D__ANDROID_API__=${android_api_level}",
      "--target=$android_abi_target",
    ]
    cflags_cc += [
      "-isystem$android_ndk_root/sources/cxx-stl/llvm-libc++/include",
      "-isystem$android_ndk_root/sources/android/support/include",
      "-isystem$android_ndk_root/sources/cxx-stl/llvm-libc++abi/include",
    ]

    # Keep these include paths *after* the above to prevent the wrong include
    # being used for some headers (e.g. math.h).
    # We need to add to each language (cflags_c, cflags_cc etc.) separately as
    # we added to cflags directly, these inludes would end up before the
    # languge and thus the above includes.
    sysroot_cflags = [
      "-isystem$android_compile_sysroot/$android_compile_sysroot_subdir",
      "-isystem$android_compile_sysroot",
    ]
    cflags_c += sysroot_cflags
    cflags_cc += sysroot_cflags

    ldflags += [
      "-Wl,-z,nocopyreloc",
      "-gcc-toolchain",
      "$android_toolchain_root",
      "--sysroot=$android_ndk_root/$android_link_sysroot_subdir",
      "--target=$android_abi_target",
      "-Wl,--exclude-libs,libunwind.a",
      "-Wl,--exclude-libs,libgcc.a",
      "-Wl,--exclude-libs,libc++_static.a",
      "-Wl,--no-undefined",
      "-Wl,-z,noexecstack",
      "-Wl,-z,relro",
      "-Wl,-z,now",
      "-Wl,--warn-shared-textrel",
      "-Wl,--fatal-warnings",

      # New NDKs need setting this to not give "unable to find library -lc++".
      # See https://github.com/android/ndk/issues/951#issuecomment-501017894.
      "-nostdlib++",
    ]
    lib_dirs = [
      "$android_ndk_root/sources/cxx-stl/llvm-libc++/libs/$android_app_abi",
    ]
    libs += [
      "gcc",
      "c++_static",
      "c++abi",
    ]

    if (current_cpu == "arm") {
      # New NDKs don't have libandroid_support for arm64.
      libs += [ "android_support" ]
    }
  }
}

config("debug_symbols") {
  cflags = []
  if (is_win) {
    cflags = [ "/Od" ]
  } else {
    cflags = [ "-O0" ]
  }
  if (is_android || is_linux) {
    cflags += [ "-funwind-tables" ]
  }
}

config("release") {
  # Compiler flags for release builds.
  if (is_win) {
    cflags = [
      "/O2",
      "/Zc:inline",
    ]
  } else if (is_android) {
    cflags = [ "-O2" ]
  } else if (is_fuzzer) {
    cflags = [ "-O1" ]
  } else {
    cflags = [ "-O3" ]
  }
  if (!is_win) {
    cflags += [
      "-fdata-sections",
      "-ffunction-sections",
    ]
  }

  # Linker flags for release builds.
  if (is_win) {
    ldflags = [
      "/OPT:REF",
      "/OPT:ICF",
      "/INCREMENTAL:NO",
      "/FIXED:NO",
    ]
  } else if (is_mac) {
    ldflags = [ "-dead_strip" ]
  } else if (!is_win && !is_wasm) {
    ldflags = [
      "-Wl,--gc-sections",
      "-Wl,--icf=all",
      "-Wl,-O1",
    ]
  }
  defines = [ "NDEBUG" ]
}

config("shared_library") {
  if (is_android || is_linux) {
    ldflags = [ "-fPIC" ]
  }
}

config("executable") {
  ldflags = []

  # Android will refuse to run executables if they aren't position independent.
  # Instead on Linux there isn't any need and they break ASan (goo.gl/paFR6K).
  # The OSS-Fuzz provided AFL library is not PIC, so we we cannot use -fPIE
  # for the fuzzer executables.
  if ((is_android || is_linux) && !is_wasm && !is_fuzzer) {
    asmflags = [ "-fPIE" ]
    cflags = [ "-fPIE" ]
    ldflags += [ "-pie" ]
  }

  # -rpath stores the path to the linked shared libraries into the binary, so
  # that they can be launched without passing any LD_LIBRARY_PATH. It's
  # supported only by Linux, not Android. But concretely we need this only when
  # use_custom_libcxx=true && custom_libcxx_is_static=false, which happens only
  # on Linux right now.
  if (is_linux && !is_wasm) {
    ldflags += [
      "-Wl,-rpath=\$ORIGIN/.",
      "-Wl,-rpath-link=.",
    ]
  }
}

# This config is only added to certain leaf target types (see BUILDCONFIG.gn).
# This allows us to remove the config (and thus the dependency) on a per-target
# basis. If the config was applied to source_sets, then they would unavoidably
# carry the dependency onto liblog to the final target.
config("android_liblog") {
  if (is_android) {
    libs = [ "log" ]
  }
}

# Checks that tools/install-build-deps has been run since it last changed.
perfetto_check_build_deps("check_build_deps") {
  args = []
}

perfetto_check_build_deps("check_build_deps_android") {
  args = [ "--android" ]
}
