#! /usr/bin/env bash

# file      : msvc-14/msvc-14u3-32
# copyright : Copyright (c) 2014-2017 Code Synthesis Ltd
# license   : MIT; see accompanying LICENSE file

# MSVC 14U3 32-bit setup/configuration (note: using 64-to-32 cross-compiler).
#
# Should set the SDKBIN, VCBIN, VCDLL, INCLUDE, and LIB variables.
#
if [ -z "$MSVC_INSTALLDIR" ]; then
  MSVC_INSTALLDIR="Microsoft Visual Studio 14.0"
fi

if [ -z "$MSVC_SDKVERSION" ]; then
  source "$src_dir/msvc-common/msvc-sdk-common"
  MSVC_SDKVERSION="$(windows10_sdkversion)"
fi

# SDK
#
SDK="C:\\Program Files (x86)\\Windows Kits\\10"
SDKBIN="$SDK\\bin\\x86"

# Originally "10.0.14393" (if upgrade 14u2) or "10.0.10240" (if clean install).
#
SDKVER="$MSVC_SDKVERSION.0"

INCLUDE="$SDK\\include\\$SDKVER\\shared;$SDK\\include\\$SDKVER\\um;$SDK\\include\\$SDKVER\\winrt"
LIB="$SDK\\lib\\$SDKVER\\um\\x86"

# CRT
#
CRT="C:\\Program Files (x86)\\Windows Kits\\10"

# Originally "10.0.14393" (if upgrade 14u2) or "10.0.10240" (if clean install).
#
CRTVER="$MSVC_SDKVERSION.0"

INCLUDE="$CRT\\include\\$CRTVER\\ucrt;$INCLUDE"
LIB="$CRT\\lib\\$CRTVER\\ucrt\\x86;$LIB"

# VC
#
VC="C:\\Program Files (x86)\\$MSVC_INSTALLDIR\\VC"
VCBIN="$VC\\bin\\amd64_x86"
VCDLL="$VC\\bin\\amd64"

INCLUDE="$VC\\include;$INCLUDE"
LIB="$VC\\lib;$LIB"