# 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_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")
}

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

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" ]

  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") {
  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) {
    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 = [
      "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
#

declare_args() {
  # 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
}

config("sanitize_address") {
  cflags = [
    "-fsanitize=address",
    "-fno-omit-frame-pointer",
  ]
  ldflags = cflags
}

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",
      "-fno-sanitize=vptr,function",
    ]
  }

  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"))
  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" ]
  }
}

declare_args() {
  # 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
}

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
  }
}
