MOZ_AUTOMATION_L10N_CHECK=0

ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
MOZ_AUTOMATION_UPDATE_PACKAGING=${MOZ_AUTOMATION_UPDATE_PACKAGING-1}
if [ -f /c/builds/gapi.data ]; then
  _gapi_keyfile=c:/builds/gapi.data
else
  _gapi_keyfile=e:/builds/gapi.data
fi
ac_add_options --with-google-api-keyfile=${_gapi_keyfile}
ac_add_options --with-mozilla-api-keyfile=c:/builds/mozilla-desktop-geoloc-api.key

. "$topsrcdir/build/mozconfig.win-common"
. "$topsrcdir/browser/config/mozconfigs/common"

ac_add_options --disable-debug
ac_add_options --enable-optimize="-O2 -gline-tables-only"
ac_add_options --enable-address-sanitizer-reporter

. "$topsrcdir/build/win64/mozconfig.vs-latest"

. "$topsrcdir/build/win64/mozconfig.asan"

export MOZ_PKG_SPECIAL=asan-reporter

# Need this to add source information into platform.ini
export MOZILLA_OFFICIAL=1

# Sandboxing is currently not compatible with the way the ASan reporter works
ac_add_options --disable-sandbox

# Enable Telemetry
# The channel reported by Telemetry here will be "nightly-asan" as specified
# in the respective override pref (toolkit.telemetry.overrideUpdateChannel),
# while the build otherwise identifies as "nightly" to receive its updates.
export MOZ_TELEMETRY_REPORTING=1

# Disable stack instrumentation until we can tackle bug 1477490
export CFLAGS="-mllvm -asan-stack=0"
export CXXFLAGS="-mllvm -asan-stack=0"

. "$topsrcdir/build/mozconfig.common.override"
