#!/usr/bin/env bash
# Copyright 2022 The Dawn & Tint Authors
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
#    list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
#    this list of conditions and the following disclaimer in the documentation
#    and/or other materials provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its
#    contributors may be used to endorse or promote products derived from
#    this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

set -e # Fail on any error.

SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd )"
ROOT_DIR="$( cd "$SCRIPT_DIR/.." >/dev/null 2>&1 && pwd )"

POSSIBLE_BUILD_SYSTEMS="[gn|cmake]"
POSSIBLE_BUILD_TYPES="[debug|release]"
POSSIBLE_BUILD_ARCHS="[native|x86]"
BUILD_FUZZER=""

BUILD_SYSTEM=""
BUILD_TYPE=""
BUILD_ARCH=""
FORCE=""
VERBOSE=""

function show_usage() {
  echo "setup-build [-f] $POSSIBLE_BUILD_SYSTEMS $POSSIBLE_BUILD_TYPES $POSSIBLE_BUILD_ARCHS [fuzz|fuzzer]"
  echo
  echo "Creates a build directory in <dawn>/out using either GN or CMake, then"
  echo "updates the '<dawn>/out/active' symlink to point to the build directory."
  echo
  echo "Options:"
  echo "  -h, --help    Print this help, then exit"
  echo "  -v, --verbose Print the generate command"
  echo "  -f, --force   Force rewrite of args.gn with specified options,"
  echo "                even if args.gn exists"
  echo "  gn            Create GN build configuration"
  echo "  cmake         Create CMake build configuration"
  echo "  release       Make a release build"
  echo "  debug         Make a debug build"
  echo "  fuzz, fuzzer  Build fuzzers. Forces Clang to be used"
  echo "  native        Target the machine you're running on"
  echo "  x86           Target a 32-bit x86 (adds -m32 to compiler flags)"
  if [[ ! -z "$1" ]]; then
    echo
    echo "$1"
  fi
  exit 1
}

function set_build_system() {
  if [[ ! -z "$BUILD_SYSTEM" ]]; then
    echo "conflicting build systems $BUILD_SYSTEM and $1"
    exit 1
  fi
  BUILD_SYSTEM=$1
}

function set_build_type() {
  if [[ ! -z "$BUILD_TYPE" ]]; then
    echo "conflicting build types $BUILD_TYPE and $1"
    exit 1
  fi
  BUILD_TYPE=$1
}

function set_build_arch() {
  if [[ ! -z "$BUILD_ARCH" ]]; then
    echo "conflicting build architectures $BUILD_ARCH and $1"
    exit 1
  fi
  BUILD_ARCH=$1
}

for arg in "$@"; do
  lowered_arg=$(echo "$arg" | tr '[:upper:]' '[:lower:]') # lowercase
  case $lowered_arg in
    "gn")
      set_build_system $lowered_arg
    ;;
    "cmake")
      set_build_system $lowered_arg
    ;;
    "debug")
      set_build_type $lowered_arg
    ;;
    "release")
      set_build_type $lowered_arg
    ;;
    "x86")
      set_build_arch $lowered_arg
    ;;
    "native")
    ;;
    "fuzz" | "fuzzer")
      BUILD_FUZZER=1
    ;;
    "--force" | "-f")
      FORCE=1
    ;;
    "--verbose" | "-v")
      VERBOSE=1
    ;;
    "--help" | "-help" | "-h")
      show_usage
    ;;
    *)
      show_usage "unknown argument '$arg'"
    ;;
  esac
done

if [[ -z "$BUILD_SYSTEM" ]]; then
  show_usage "build system $POSSIBLE_BUILD_SYSTEMS is required"
fi

if [[ -z "$BUILD_TYPE" ]]; then
  show_usage "build type $POSSIBLE_BUILD_TYPES required"
fi

BUILD_DIR="$BUILD_SYSTEM-$BUILD_TYPE"
if [[ ! -z "$BUILD_ARCH" ]]; then
  BUILD_DIR+="-$BUILD_ARCH"
fi
if [[ ! -z "$BUILD_FUZZER" ]]; then
  BUILD_DIR+="-fuzz"
fi

function generate() {
  pushd "$ROOT_DIR" > /dev/null
    test -n "$VERBOSE" && echo mkdir -p "out/$BUILD_DIR"
    mkdir -p "out/$BUILD_DIR"
    rm -fr "out/active" || true
    ln -s "$BUILD_DIR" "out/active"
    test -n "$VERBOSE" && echo "$@"
    "$@"
  popd > /dev/null
}

case $BUILD_SYSTEM in
  "gn")
    GN_ARGS=""
    case $BUILD_TYPE in
      "debug")
        GN_ARGS+="is_debug=true"
      ;;
      "release")
        GN_ARGS+="is_debug=false"
      ;;
      *)
        show_usage "invalid build type '$BUILD_TYPE'"
      ;;
    esac
    case $BUILD_ARCH in
      "")
      ;;
      "x86")
        GN_ARGS+=" target_cpu=\"x86\""
      ;;
      *)
        show_usage "invalid build architecture '$BUILD_ARCH'"
      ;;
    esac
    if [[ -n "$BUILD_FUZZER" ]]; then
        GN_ARGS+=" use_libfuzzer=true"
        GN_ARGS+=" tint_build_ir_binary=true"
        GN_ARGS+=" tint_build_ir_fuzzer=true"
    fi
    if [[ -z "$FORCE" && -f "$ROOT_DIR/out/$BUILD_DIR/args.gn" ]]; then
      generate "gn" "gen" "out/active" # keep existing args
    else
      generate "gn" "gen" "out/active" "--args=$GN_ARGS"
    fi
  ;;
  "cmake")
    CMAKE_FLAGS=()
    CMAKE_FLAGS+=("-DTINT_BUILD_GLSL_WRITER=1")
    CMAKE_FLAGS+=("-DTINT_BUILD_HLSL_WRITER=1")
    CMAKE_FLAGS+=("-DTINT_BUILD_MSL_WRITER=1")
    CMAKE_FLAGS+=("-DTINT_BUILD_SPV_WRITER=1")
    CMAKE_FLAGS+=("-DTINT_BUILD_WGSL_WRITER=1")
    CMAKE_FLAGS+=("-DTINT_BUILD_TINTD=1")
    CMAKE_FLAGS+=("-DDAWN_BUILD_NODE_BINDINGS=1")
    if [[ -n "$BUILD_FUZZER" ]]; then
        CMAKE_FLAGS+=("-DCMAKE_CXX_COMPILER=clang++")
        CMAKE_FLAGS+=("-DCMAKE_C_COMPILER=clang")
        CMAKE_FLAGS+=("-DTINT_BUILD_FUZZERS=ON")
        CMAKE_FLAGS+=("-DDAWN_BUILD_PROTOBUF=ON")
        CMAKE_FLAGS+=("-DTINT_BUILD_IR_FUZZER=ON")
        CMAKE_FLAGS+=("-DTINT_BUILD_IR_BINARY=ON")
        CMAKE_FLAGS+=("-DDAWN_USE_BUILT_DXC=ON")  # TODO(b/348200364)
    fi
    if [[ -x $(command -v ccache) ]]; then
      CMAKE_FLAGS+=("-DCMAKE_CXX_COMPILER_LAUNCHER=ccache")
    fi
    case $BUILD_TYPE in
      "debug")
        CMAKE_FLAGS+=("-DCMAKE_BUILD_TYPE=Debug")
      ;;
      "release")
        CMAKE_FLAGS+=("-DCMAKE_BUILD_TYPE=RelWithDebInfo")
      ;;
      *)
        show_usage "invalid build type '$BUILD_TYPE'"
      ;;
    esac
    case $BUILD_ARCH in
      "")
      ;;
      "x86")
        CMAKE_FLAGS+=("-DCMAKE_CXX_FLAGS=-m32")
        CMAKE_FLAGS+=("-DCMAKE_C_FLAGS=-m32")
      ;;
      *)
        show_usage "invalid build architecture '$BUILD_ARCH'"
      ;;
    esac
    generate "cmake"             \
             "-S" "."            \
             "-B" "out/active"   \
             "-GNinja"           \
             "${CMAKE_FLAGS[@]}"
  ;;
  *)
    echo "invalid build system '$BUILD_SYSTEM'"
    show_usage
  ;;
esac
