require('vstudio')

local vs = premake.vstudio.vc2010

local function premakeVersionComment(prj)
    premake.w('<!-- Generated by Premake ' .. _PREMAKE_VERSION .. ' -->')
end

local function vcpkg(prj)
    premake.w('<VcpkgTriplet>x64-windows-static</VcpkgTriplet>')
    premake.w('<VcpkgEnabled>true</VcpkgEnabled>')
    premake.w('<VcpkgEnableManifest>true</VcpkgEnableManifest>')
end

premake.override(premake.vstudio.vc2010.elements, "project", function(base, prj)
    local calls = base(prj)
    table.insertafter(calls, vs.xmlDeclaration, premakeVersionComment)
    return calls
end)

premake.override(premake.vstudio.vc2010.elements, "globals", function(base, prj)
    local calls = base(prj)
    table.insertafter(calls, vs.globals, vcpkg)
    return calls
end)

workspace "Nimbus"
   architecture "x64"
   configurations { "Debug", "Release", "Dist" }
   startproject "Nimbus App"
   
   flags
	{
		"MultiProcessorCompile"
	}

   -- Workspace-wide build options for MSVC
   filter "system:windows"
      buildoptions { "/utf-8", "/EHsc", "/Zc:preprocessor", "/Zc:__cplusplus"} -- "/incremental" 
      openmp "On"
      --enableunitybuild "On"

OutputDir = "%{cfg.system}-%{cfg.architecture}/%{cfg.buildcfg}"

include "Core/Build-Core.lua"
include "App/Build-App.lua"
