www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.ldc - LDC & Visual C++ Build Tools 2015

reply Andre Pany <andre s-e-a-p.de> writes:
Hi,

is there a how to or wiki page, how to use LDC in combination 
with "Visual C++ Build Tools 2015".
It seems the build tools are the easiest way to get the microsoft 
build tools (linker) without installing a full IDE.

https://blogs.msdn.microsoft.com/vcblog/2016/03/31/announcing-the-official-release-of-the-visual-c-build-tools-2015/

Kind regards
André
May 17 2016
parent reply David Nadlinger via digitalmars-d-ldc <digitalmars-d-ldc puremagic.com> writes:
Hi Andre,

On 17 May 2016, at 17:38, Andre Pany via digitalmars-d-ldc wrote:
 is there a how to or wiki page, how to use LDC in combination with 
 "Visual C++ Build Tools 2015".
I don't know whether any of the devs using Windows got a chance to test the Build Tools on a system that doesn't have the full IDE installed, but in theory it should work just fine. As for building LDC itself, CMake should automatically detect their presence if I remember correctly, so everything should work out of the box. For using them together with a binary LDC release, the question is whether we detect it correctly in executeMsvcToolAndWait() (driver/linker.cpp). I assume the build tools also come with a link to the script that sets up the environment variables for use with the C++ toolchain? Launching LDC from that should definitely work. It would be great if you could give it a try and share your experiences on the wiki afterwards (if everything works nicely, it should just be a short note). As you mentioned, we should really document this well to make using LDC a seamless experience (and possibly even automatically download the tools from a to-be-written LDC installer). Best, David
May 17 2016
parent Andre Pany <andre s-e-a-p.de> writes:
On Tuesday, 17 May 2016 at 18:11:47 UTC, David Nadlinger wrote:
 Hi Andre,

 On 17 May 2016, at 17:38, Andre Pany via digitalmars-d-ldc 
 wrote:
 is there a how to or wiki page, how to use LDC in combination 
 with "Visual C++ Build Tools 2015".
I don't know whether any of the devs using Windows got a chance to test the Build Tools on a system that doesn't have the full IDE installed, but in theory it should work just fine. As for building LDC itself, CMake should automatically detect their presence if I remember correctly, so everything should work out of the box. For using them together with a binary LDC release, the question is whether we detect it correctly in executeMsvcToolAndWait() (driver/linker.cpp). I assume the build tools also come with a link to the script that sets up the environment variables for use with the C++ toolchain? Launching LDC from that should definitely work. It would be great if you could give it a try and share your experiences on the wiki afterwards (if everything works nicely, it should just be a short note). As you mentioned, we should really document this well to make using LDC a seamless experience (and possibly even automatically download the tools from a to-be-written LDC installer). Best, David
Hi David, some findings so far: -> Whether C++ Build Tools are installed could be checked by regedit value: HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\VisualCppBuildTools\14.0 Installed = 1 As far as I understand, the product path seems to be located here: HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\VisualStudio\14.0\Setup\VC ProductDir = C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ The existing batch script C:\D\ldc2\bin\msvcEnv.bat needs to extract this information from the windows registry and write the product path without the ending "VC\" into environment variable LDC_VSDIR => In the last line of the batch "VC\" is concatenated to the environment variable ldc2 will find the linker, if I set the environment variable like this SET LDC_VSDIR=C:\Program Files (x86)\Microsoft Visual Studio 14.0\ Kind regards André Kind regards André
May 17 2016