Home » Developing U++ » U++ Developers corner » Is U++ compatible with VC++ Express 2012?
Re: Is U++ compatible with VC++ Express 2012? [message #40217 is a reply to message #40212] |
Fri, 05 July 2013 08:46 |
Sender Ghost
Messages: 301 Registered: November 2008
|
Senior Member |
|
|
nlneilson wrote on Wed, 03 July 2013 15:15 | As a side note the M$VS 2013 Preview is now available.
|
Ok, I created redmine issue and necessary patch for this feature.
I used following console application to get path, include and library directories:
Toggle source code
#include <Core/Core.h>
using namespace Upp;
String NormalizePathNN(const String& path)
{
return IsNull(path) ? path : NormalizePath(path);
}
bool ExistProgram(String& bin, const char *dir, const char *file)
{
String win = NormalizePath(GetWindowsDirectory());
if (FileExists(AppendFileName(win.Mid(0, 3) + dir, file))) {
bin = win.Mid(0, 3) + dir;
return true;
}
return false;
}
bool OrderOfFiles(const String& a, const String& b)
{
return stricmp(a, b) < 0;
}
void PrintDir(const String& dir, Vector<String>& list)
{
FindFile ff(AppendFileName(dir, "*.*"));
int from = dir.EndsWith(AsString(DIR_SEP)) ? dir.GetCount() : dir.GetCount() + 1;
Vector<String> dirs, files;
while (ff) {
String p = AppendFileName(dir, ff.GetName());
if (ff.IsFile())
files.Add(p.Mid(from));
if (ff.IsFolder())
dirs.Add(p);
ff.Next();
}
Sort(dirs, &OrderOfFiles);
Sort(files, &OrderOfFiles);
if (!files.IsEmpty()) {
list.Add(dir);
RLOG("--> " << dir);
for (int i = 0, n = files.GetCount(); i < n; ++i)
RLOG(files[i]);
}
for (int i = 0, n = dirs.GetCount(); i < n; ++i)
PrintDir(dirs[i], list);
}
CONSOLE_APP_MAIN
{
String sdk = NormalizePathNN(GetWinRegString("InstallationFolder",
"SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v8.1",
HKEY_LOCAL_MACHINE));
String bin;
if (!IsNull(sdk) && FileExists(AppendFileName(sdk, "VC\\bin\\cl.exe"))) {
bin = sdk;
}
else
ExistProgram(bin, "Program Files (x86)\\Microsoft Visual Studio 12.0", "VC\\bin\\cl.exe")
|| ExistProgram(bin, "Program Files\\Microsoft Visual Studio 12.0", "VC\\bin\\cl.exe");
RDUMP(bin);
RDUMP(sdk);
if (!IsNull(bin))
RLOG("MSC12 supported");
String vc_64 = AppendFileName(bin, "VC\\bin\\x64");
if (!FileExists(AppendFileName(vc_64, "cl.exe")))
vc_64 = AppendFileName(bin, "VC\\bin\\x86_amd64");
if (bin.GetLength() && FileExists(AppendFileName(vc_64, "cl.exe")))
RLOG("MSC12x64 supported");
if (IsNull(sdk) || IsNull(bin))
return;
String pathbin = AppendFileName(bin, "VC\\bin"),
pathsdk = AppendFileName(sdk, "bin"),
incbin = AppendFileName(bin, "VC\\include"),
incsdk = AppendFileName(sdk, "Include"),
libbin = AppendFileName(bin, "VC\\lib"),
libsdk = AppendFileName(sdk, "Lib");
RLOG("Path files:");
{
Vector<String> bins;
PrintDir(pathbin, bins);
PrintDir(pathsdk, bins);
RDUMPC(bins);
}
RLOG("Include files:");
{
Vector<String> includes;
PrintDir(incbin, includes);
PrintDir(incsdk, includes);
RDUMPC(includes);
}
RLOG("Library files:");
Vector<String> libs;
PrintDir(libbin, libs);
PrintDir(libsdk, libs);
RDUMPC(libs);
}
In the attachments you could find log file output and MSC12 builder files (for patched TheIDE).
|
|
|
Goto Forum:
Current Time: Fri Nov 01 00:05:43 CET 2024
Total time taken to generate the page: 0.01035 seconds
|