5

Is there a way to use devenv.exe on the command line to link-only a project instead of full-build a project?

devenv.exe /? provides the below commands, none of which appear able to link-only a project instead of full-build a project.

/Build /Clean /Command /Deploy /Edit /LCID /Log /NoVSIP /Out /Project /ProjectConfig /Rebuild /ResetAddin /ResetSettings /ResetSkipPkgs /Run /RunExit /SafeMode /Upgrade

I am interested in this because the /LTCG:PGOPTIMIZE phase of profile-guided optimization entails a relink without a recompile.

KMoraz
  • 14,004
  • 3
  • 49
  • 82
Neil Justice
  • 1,325
  • 2
  • 12
  • 25

2 Answers2

2

I found that vcbuild.exe can be used to perform a link-only using its /forcelink option:

vcbuild.exe PgoProject.vcproj "ReleasePGOptimize|x64" /forcelink

link.exe would also work, though with increased difficulty in getting the arguments right, because link.exe does not accept a .vcproj file containing the linker flags whereas vcbuild.exe does.

Neil Justice
  • 1,325
  • 2
  • 12
  • 25
1

You can simply invoke link.exe (the linker) with the appropriate parameters. There's no need to involve devenv.exe.

Jon
  • 428,835
  • 81
  • 738
  • 806