# Copyright (c) 2020 Project CHIP Authors
#
# 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("//build_overrides/build.gni")
import("//build_overrides/pigweed.gni")
import("//build_overrides/pigweed_environment.gni")
import("${build_root}/chip/java/config.gni")
import("${build_root}/config/compiler/compiler.gni")
import("${build_root}/config/sysroot.gni")
import("${build_root}/config/target.gni")

if (current_os == "mac" || current_os == "ios") {
  import("${build_root}/config/mac/mac_sdk.gni")
}

# To use different sanitizer options, use `gn args .` in the out folder and
# use settings like:
#
#   is_clang=true
#   is_debug=true
#   optimize_for_size=false
#   is_asan=true
#   is_sanitize_fatal=false
#

declare_args() {
  # Enable -Werror. This can be disabled if using a different compiler
  # with unfixed or unsupported wanings.
  treat_warnings_as_errors = true

  # Enable Thread sanitizer
  is_tsan = false

  # Enable memory sanitizer
  is_msan = false

  # enable undefined behavior sanitizer
  is_ubsan = false

  # Exit on sanitize error. Generally standard libraries may get errors
  # so not stopping on the first error is often useful
  is_sanitize_fatal = true

  # Enable or disable Runtime Type Information (RTTI).
  # Defaults true on darwin because Darwin.framework uses it.
  enable_rtti = current_os == "mac" || current_os == "ios"

  # Enable or disable support for C++ exceptions.
  enable_exceptions = false
}

if (current_cpu == "arm" || current_cpu == "arm64") {
  import("${build_root}/config/arm.gni")
} else if (current_cpu == "x86" || current_cpu == "x86_64") {
  import("${build_root}/config/x86.gni")
} else if (current_cpu == "riscv") {
  import("${build_root}/config/riscv.gni")
}

config("release") {
  defines = [ "NDEBUG" ]
}

config("debug_default") {
  if (!is_debug) {
    configs = [ ":release" ]
  }
}

config("abi_default") {
  cflags = []
  if (current_os == "mac" || current_os == "ios") {
    cflags += [
      "-target",
      mac_target_triple,
    ]
  }

  if (current_os != "mac" && current_os != "ios") {
    if (current_cpu == "arm" || current_cpu == "arm64") {
      if (current_os == "linux" && is_clang) {
        if (current_cpu == "arm") {
          cflags += [ "--target=armv7-linux-gnueabihf" ]
        } else if (current_cpu == "arm64") {
          cflags += [ "--target=aarch64-linux-gnu" ]
        }
      }

      if (arm_arch != "") {
        cflags += [ "-march=${arm_arch}" ]
      }
      if (arm_cpu != "") {
        cflags += [ "-mcpu=${arm_cpu}" ]
      }
      if (arm_tune != "") {
        cflags += [ "-mtune=${arm_tune}" ]
      }
      if (arm_abi != "") {
        cflags += [ "-mabi=${arm_abi}" ]
      }
      if (arm_fpu != "") {
        cflags += [ "-mfpu=${arm_fpu}" ]
      }
      if (arm_float_abi != "") {
        cflags += [ "-mfloat-abi=${arm_float_abi}" ]
      }
      if (arm_use_thumb) {
        cflags += [ "-mthumb" ]
      }
    }
    if (current_cpu == "x86" || current_cpu == "x86_64") {
      if (x86_arch != "") {
        cflags += [ "-march=${x86_arch}" ]
      }
      if (x86_cpu != "") {
        cflags += [ "-mcpu=${x86_cpu}" ]
      }
      if (x86_tune != "") {
        cflags += [ "-mtune=${x86_tune}" ]
      }

      if (current_cpu == "x86_64") {
        cflags += [
          "-msse4.2",
          "-mpopcnt",
          "-m64",
        ]
      } else if (current_cpu == "x86") {
        cflags += [
          "-mssse3",
          "-mfpmath=sse",
          "-m32",
        ]
      }
    }
    if (current_cpu == "riscv") {
      if (riscv_arch != "") {
        cflags += [ "-march=${riscv_arch}" ]
      }
      if (riscv_cpu != "") {
        cflags += [ "-mcpu=${riscv_cpu}" ]
      }
      if (riscv_tune != "") {
        cflags += [ "-mtune=${riscv_tune}" ]
      }
      if (riscv_abi != "") {
        cflags += [ "-mabi=${riscv_abi}" ]
      }
      if (riscv_fpu != "") {
        cflags += [ "-mfpu=${riscv_fpu}" ]
      }
      if (riscv_float_abi != "") {
        cflags += [ "-mfloat-abi=${riscv_float_abi}" ]
      }
    }
  }

  asmflags = cflags
  ldflags = cflags
}

config("dead_code_elimination_default") {
  # Delete unreferenced sections. Helpful with -ffunction-sections.
  if (current_os == "mac" || current_os == "ios") {
    ldflags = [ "-Wl,-dead_strip" ]
  } else {
    ldflags = [ "-Wl,--gc-sections" ]
  }
}

config("target_default") {
  if (current_toolchain == default_toolchain) {
    defines = target_defines
    cflags = target_cflags
    cflags_c = target_cflags_c
    cflags_cc = target_cflags_cc
    ldflags = target_ldflags
  }
}

config("optimize_zero") {
  cflags = [ "-O0" ]
  ldflags = cflags
}

config("optimize_debug") {
  cflags = [ "-O${optimize_debug_level}" ]
  ldflags = cflags
}

config("optimize_default") {
  if (is_debug) {
    if (optimize_debug) {
      configs = [ ":optimize_debug" ]
    } else {
      configs = [ ":optimize_zero" ]
    }
  } else {
    if (optimize_for_size) {
      configs = [ "$dir_pw_build:optimize_size" ]
    } else {
      configs = [ "$dir_pw_build:optimize_speed" ]
    }

    if (current_os != "mac") {
      ldflags = [
        "-Wl,-O2",
        "-Wl,--gc-sections",
      ]
    }
  }
}

config("disabled_warnings") {
  cflags = [
    "-Wno-deprecated-declarations",
    "-Wno-missing-field-initializers",
    "-Wno-unknown-warning-option",
    "-Wno-unused-parameter",
  ]
  if (!is_debug) {
    # assert() causes unused variable warnings in release.
    cflags += [ "-Wno-unused" ]
  }
  if (!is_clang) {
    cflags += [
      "-Wno-cast-function-type",
      "-Wno-psabi",
      "-Wno-maybe-uninitialized",
    ]
  }
}

config("warnings_common") {
  cflags = [ "-Wall" ]

  ldflags = []
  if (treat_warnings_as_errors) {
    cflags += [ "-Werror" ]
    ldflags += [ "-Werror" ]
  }

  if (current_os != "mac" && current_os != "ios") {
    ldflags += [ "-Wl,--fatal-warnings" ]
  }

  if (current_os != "mac" && current_os != "ios" && current_os != "linux" &&
      current_os != "win" && current_os != "tizen" && current_os != "webos" &&
      current_os != "cmsis-rtos") {
    cflags += [ "-Wstack-usage=8192" ]
  }
}

config("strict_warnings") {
  cflags = [
    "-Wextra",
    "-Wshadow",
    "-Wunreachable-code",
    "-Wvla",
    "-Wformat",
    "-Wformat-nonliteral",
    "-Wformat-security",
  ]

  if (current_os == "webos") {
    cflags -= [
      "-Wshadow",
      "-Wvla",
    ]
  }

  if (current_os == "mac" || current_os == "ios") {
    cflags += [ "-Wconversion" ]
  }

  # For now we can't enable -Wundef across the board.  Enable it where
  # we can.  Ideally this would be checking chip_device_platform or so
  # to be more fine-grained than current_os, but it's not clear that
  # we can access that here.
  if (current_os != "freertos" && current_os != "mbed" &&
      # cmsis-rtos is OpenIOT
      current_os != "cmsis-rtos" &&
      # cyw30739 is one of the Infineon builds
      current_os != "cyw30739") {
    cflags += [ "-Wundef" ]
  }

  if (matter_enable_java_compilation) {
    cflags -= [ "-Wshadow" ]
  }

  cflags_cc = [ "-Wnon-virtual-dtor" ]

  if (current_os == "nuttx") {
    cflags -= [ "-Wshadow" ]
    cflags_cc -= [ "-Wnon-virtual-dtor" ]
  }

  configs = []
  ldflags = []

  if (is_clang) {
    cflags += [
      "-Wimplicit-fallthrough",
      "-Wheader-hygiene",
      "-Wshorten-64-to-32",
      "-Wformat-type-confusion",
    ]

    configs += [ "$dir_pw_build:clang_thread_safety_warnings" ]

    # TODO: can make this back fatal in once pigweed updates can be taken again.
    #       See https://github.com/project-chip/connectedhomeip/pull/22079
    #
    # Currently `./scripts/build/build_examples.py --target linux-arm64-light-rpc-ipv6only-clang build`
    # fails in third_party/pigweed/repo/pw_protobuf
    if (current_cpu == "arm64" && current_os == "linux") {
      cflags += [ "-Wno-error=shorten-64-to-32" ]
    }
  }

  if (!is_asan && (current_os == "linux" || current_os == "android")) {
    ldflags += [ "-Wl,-z,defs" ]
  }
}

config("warnings_default") {
  configs = [
    ":warnings_common",
    ":strict_warnings",
    ":disabled_warnings",
  ]
}

config("disabled_warnings_third_party") {
  cflags = [
    "-Wno-unused",
    "-Wno-format",
    "-Wno-address",
  ]

  if (!is_clang) {
    cflags += [ "-Wno-maybe-uninitialized" ]
  }
}

config("warnings_third_party") {
  configs = [
    ":warnings_common",
    ":disabled_warnings",
    ":disabled_warnings_third_party",
  ]
}

config("symbols_default") {
  if (strip_symbols) {
    cflags = [ "-s" ]
  } else {
    cflags = [ "-g${symbol_level}" ]
  }
}

config("std_default") {
  cflags_c = [ "-std=${c_standard}" ]
  cflags_objc = [ "-std=${c_standard}" ]
  cflags_cc = [ "-std=${cpp_standard}" ]
  cflags_objcc = [ "-std=${cpp_standard}" ]
}

config("cosmetic_default") {
  configs = [ "$dir_pw_build:colorize_output" ]
}

config("runtime_default") {
  if (is_clang &&
      current_os == "mac") {  # Using Pigweed clang instead of Darwin host clang
    # Without pw_env_setup_CIPD_PIGWEED defined the hostclang:no_system_libcpp
    # config silently uses the system libc++, usually resulting in linker errors.
    assert(
        defined(pw_env_setup_CIPD_PIGWEED),
        "//build_overrides/pigweed_environment.gni must define pw_env_setup_CIPD_PIGWEED when using pigweed clang")

    configs = [
      "$dir_pw_toolchain/host_clang:no_system_libcpp",
      "$dir_pw_toolchain/host_clang:xcode_sysroot",
    ]
  }
  if (current_os == "linux" || current_os == "tizen" || current_os == "webos") {
    libs = [
      "atomic",
      "dl",
      "pthread",
      "rt",
    ]
  }

  cflags = []
  ldflags = []

  if (sysroot != "") {
    cflags += [ "--sysroot=${sysroot}" ]
    ldflags += [ "--sysroot=${sysroot}" ]
  }

  cflags += runtime_library_cflags
  ldflags += runtime_library_ldflags
}

# To use different sanitizer options, use `gn args .` in the out folder and
# use settings like:
#
#   is_clang=true
#   is_debug=true
#   optimize_for_size=false
#   is_asan=true
#   is_sanitize_fatal=false
#

config("sanitize_address") {
  defines = []
  cflags = [
    "-fsanitize-coverage=inline-8bit-counters,trace-cmp",
    "-fno-sanitize-coverage=pc-table",
    "-fsanitize=address",
    "-fno-omit-frame-pointer",
  ]
  ldflags = cflags

  if ((target_os == "mac" || target_os == "ios") && !is_clang) {
    defines += [ "_LIBCPP_HAS_NO_ASAN" ]
  }
}

config("sanitize_thread") {
  cflags = [ "-fsanitize=thread" ]
  ldflags = cflags
}

config("sanitize_memory") {
  cflags = [
    "-fsanitize=memory",
    "-fsanitize-memory-track-origins",
    "-fno-omit-frame-pointer",
  ]
  ldflags = cflags
}

config("sanitize_undefined_behavior") {
  cflags = [
    "-fvisibility=hidden",
    "-fsanitize=undefined",
    "-fsanitize=float-divide-by-zero",
  ]
  if (is_clang) {
    cflags += [
      "-fsanitize=unsigned-integer-overflow",
      "-fsanitize=implicit-conversion",
      "-fsanitize=nullability",
    ]
  }

  #According to the LLVM UBSan documentation, sanitizing vptr is incompatible with the -fno-rtti flag.
  if (!enable_rtti) {
    cflags += [ "-fno-sanitize=vptr" ]
  }

  ldflags = cflags
}

config("sanitize_recover_all") {
  cflags = [ "-fsanitize-recover=all" ]
  ldflags = cflags
}

config("sanitize_default") {
  configs = []

  if (is_tsan) {
    configs += [ ":sanitize_thread" ]
  }

  if (is_asan) {
    configs += [ ":sanitize_address" ]
  }

  if (is_msan) {
    configs += [ ":sanitize_memory" ]
  }

  if (is_ubsan) {
    configs += [ ":sanitize_undefined_behavior" ]
  }

  if (!is_sanitize_fatal) {
    configs += [ ":sanitize_recover_all" ]
  }
}

config("libfuzzer_fuzzing") {
  cflags = [ "-fsanitize=fuzzer" ]
  ldflags = cflags
}

config("oss_fuzz") {
  cflags = string_split(getenv("CFLAGS"))
  cflags_cc = string_split(getenv("CXXFLAGS"))
  ldflags = string_split(getenv("CXXFLAGS"))
  ldflags += [ getenv("LIB_FUZZING_ENGINE") ]
}

config("fuzzing_default") {
  configs = []
  if (is_libfuzzer) {
    configs += [ ":libfuzzer_fuzzing" ]
  }
  if (oss_fuzz) {
    configs += [ ":oss_fuzz" ]
  }
}

config("coverage") {
  cflags = [ "--coverage" ]
  ldflags = cflags
}

config("coverage_default") {
  configs = []
  if (use_coverage) {
    configs += [ ":coverage" ]
  }
}

config("no_rtti") {
  cflags_cc = [ "-fno-rtti" ]
}

config("rtti") {
  cflags_cc = [ "-frtti" ]
}

config("rtti_default") {
  if (enable_rtti) {
    configs = [ ":rtti" ]
  } else {
    configs = [ ":no_rtti" ]
  }
}

config("no_exceptions") {
  cflags = [ "-fno-exceptions" ]
}

config("exceptions") {
  cflags = [ "-fexceptions" ]
}

config("exceptions_default") {
  if (enable_exceptions) {
    configs = [ ":exceptions" ]
  } else {
    configs = [ ":no_exceptions" ]
  }
}

config("unwind_tables") {
  cflags = [ "-funwind-tables" ]
}

config("no_unwind_tables") {
  cflags = [
    "-fno-unwind-tables",
    "-fno-asynchronous-unwind-tables",
  ]
}

config("unwind_tables_default") {
  if (exclude_unwind_tables) {
    configs = [ ":no_unwind_tables" ]
  } else {
    configs = [ ":unwind_tables" ]
  }
}

config("size_default") {
  cflags = [
    "-fno-common",
    "-ffunction-sections",
    "-fdata-sections",
  ]

  # do not export functions in jni, or --gc-sections will not work and will be some undefined issues
  if (current_os == "android") {
    cflags += [ "-fvisibility=hidden" ]
  }
}

config("stack_protector_default") {
  cflags = [ "-fno-stack-protector" ]
}

config("prefix_mappings_default") {
  cflags = []
  foreach(prefix_mapping, prefix_mappings) {
    cflags += [ "-fdebug-prefix-map=${prefix_mapping}" ]
  }
}

config("pic_default") {
  if (enable_pic) {
    cflags = [ "-fPIC" ]
    ldflags = cflags
  }
}

config("pie_default") {
  if (enable_pie) {
    ldflags = [ "-pie" ]
  }
}

config("aliasing_default") {
  cflags = [ "-fno-strict-aliasing" ]
}

config("specs_default") {
  if (current_cpu == "arm" && current_os == "freertos" && !is_clang) {
    cflags = [
      "--specs=nosys.specs",
      "--specs=nano.specs",
    ]

    libs = [ "nosys" ]

    ldflags = cflags
  }
}
