# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

executable("sky_snapshot") {
  sources = [
    "loader.cc",
    "loader.h",
    "logging.cc",
    "logging.h",
    "main.cc",
    "scope.h",
    "switches.cc",
    "switches.h",
    "vm.cc",
    "vm.h",
  ]

  deps = [
    "//base",
    "//dart/runtime/vm:libdart_platform",
    "//dart/runtime:libdart",
    "//sky/engine/bindings:snapshot_cc",
    "//sky/engine/tonic/parsers",
    "//third_party/zlib",
  ]

  if (!is_ios && !is_mac) {
    ldflags = [
      # libgcc_s is not a DT_NEEDED library; it normally gets loaded implicitly.
      # This flag ensures that rpath is referenced when searching for
      # the so, which in turn gets the resulting sky_snapshot binary
      # closer to being able to run in Google's production environment.
      "-lgcc_s",
    ]
  }

  if (flutter_develop_mode) {
    defines = [ "FLUTTER_DEVELOP_MODE=1" ]
  }
}
