Skip to content

Instantly share code, notes, and snippets.

@niklas-ourmachinery
Created August 15, 2017 05:55
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save niklas-ourmachinery/f529b3c8aae4159b86a0ee25253a185a to your computer and use it in GitHub Desktop.
Save niklas-ourmachinery/f529b3c8aae4159b86a0ee25253a185a to your computer and use it in GitHub Desktop.
Using a random file name for Program Database File

Use a "random" name for the PDB instead of vc141.pdb.

Visual Studio Option:

/Fd$(IntDir)$(TargetName)-$([System.DateTime]::Now.ToString("HH_mm_ss_fff")).pdb

Premake5 configuration (at top of premake5.lua):

local function programDataBaseFileName(prj)
    premake.w('<ProgramDataBaseFileName>$(IntDir)$(TargetName)-$([System.DateTime]::Now.ToString("HH_mm_ss_fff")).pdb</ProgramDataBaseFileName>')
end

premake.override(premake.vstudio.vc2010.elements, "clCompile", function(base, prj)
      local calls = base(prj)
      table.insertafter(calls, calls.debugInformationFormat, programDataBaseFileName)
      return calls
end)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment