DynamoRIO / DynamoRIO/dynamorio

runsuite_common_pre.cmake fails to switch to x64 env for VS2010 Express: switch to use vcvars?

Open
#1,508 0 comments 0 reactions 0 assignees View on GitHub
Component-Build help wanted Migrated OpSys-Windows Priority-Medium Type-Feature
Dominant language
C
Stars
3.2k
Forks
629
Avg merge
2d 15h
Merged PRs (30d)
31

Description

_From [bruen...@google.com](https://code.google.com/u/109494838902877177630/) on August 13, 2014 11:39:00_

In general there are two SDK paths that VS uses:

C:\Program Files (x86)\Microsoft SDKs\Windows\
C:\Program Files\Microsoft SDKs\Windows\

In runsuite_common_pre.cmake our strategy is to assume the 32-bit env is
set up and that we can just tweak the PATH, LIB, and LIBPATH env vars to
shift to 64-bit by simply appending amd64 or x64 to the directories.

However, VS2010 Express does not have 64-bit rc.exe in the x86 progfiles
SDK, yet it points the 32-bit PATH at the x86 SDK dir. VS 2010
Professional does the same PATH setup, but it also has 64-bit in the x86
SDK, so it all works out.

My bash functions set up the 64-bit SDK dirs, b/c I modeled them after the
VS2008, not VS2010.

This issue covers solving this by switching runsuite_common_pre.cmake to
instead locate and use the vcvars batch files to set the environment
automatically. This would also handle people invoking the suite with the
64-bit env set up.

There are two challenges here:

First, which one to use if user has multiple VS installed? As the script
is now it nicely works w/ whatever user sets up for (for ninja anyway).
We'd have to have params to allow picking.

Second, we'll have to do something like generate a .bat that invokes vcvars
and then echoes PATH (and LIB and LIBPATH), and then cmake has to parse
that and then set the env vars itself, to get them set inside its process.

_Original issue: http://code.google.com/p/dynamorio/issues/detail?id=1508_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.