mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
PCH can now be set from local menu, just like Optimize for speed
git-svn-id: svn://ultimatepp.org/upp/trunk@8036 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
4c02b80134
commit
a1db87ca82
7 changed files with 26 additions and 6 deletions
|
|
@ -310,7 +310,7 @@ bool MscBuilder::BuildPackage(const String& package, Vector<String>& linkfile, V
|
|||
if(ext == ".lib")
|
||||
linkfile.Add(fn);
|
||||
else
|
||||
if(findarg(ext, ".h", ".hpp", ".hh", ".hxx") >= 0 && pkg[i].pch && allow_pch && IsMsc89() && release && !HasAnyDebug() && !blitz) {
|
||||
if(IsHeaderExt(ext) >= 0 && pkg[i].pch && allow_pch && IsMsc89() && release && !HasAnyDebug() && !blitz) {
|
||||
if(pch_header.GetCount())
|
||||
PutConsole(GetFileName(fn) + ": multiple PCH is not allowed. Check your package configuration");
|
||||
else
|
||||
|
|
|
|||
|
|
@ -91,6 +91,11 @@ void PutVerbose(const char *s) { if(the_ide) the_ide->PutVerbose(s); }
|
|||
void PutLinking() { if(the_ide) the_ide->PutLinking(); }
|
||||
void PutLinkingEnd(bool ok) { if(the_ide) the_ide->PutLinkingEnd(ok); }
|
||||
|
||||
bool IsHeaderExt(const String& ext)
|
||||
{
|
||||
return findarg(ext, ".h", ".hpp", ".hh", ".hxx") >= 0;
|
||||
}
|
||||
|
||||
const Workspace& GetIdeWorkspace()
|
||||
{
|
||||
if(the_ide)
|
||||
|
|
|
|||
|
|
@ -431,6 +431,8 @@ bool HdependBlitzApproved(const String& path);
|
|||
const Vector<String>& HdependGetDefines(const String& path);
|
||||
const Vector<String>& HdependGetAllFiles();
|
||||
|
||||
bool IsHeaderExt(const String& ext);
|
||||
|
||||
class BinObjInfo {
|
||||
public:
|
||||
BinObjInfo();
|
||||
|
|
|
|||
|
|
@ -373,7 +373,7 @@ void PackageEditor::FileCursor()
|
|||
String p = GetActiveFilePath();
|
||||
String ext = ToLower(GetFileExt(p));
|
||||
bool tpp = ext == ".tpp" && IsFolder(p);
|
||||
bool hdr = findarg(ext, ".h", ".hpp", ".hh", ".hxx") >= 0 && !tpp;
|
||||
bool hdr = IsHeaderExt(ext) && !tpp;
|
||||
optimize_speed_file.Enable(!tpp);
|
||||
optimize_speed_file <<= f.optimize_speed;
|
||||
pch_file.Enable(hdr);
|
||||
|
|
|
|||
|
|
@ -348,6 +348,7 @@ struct WorkspaceWork {
|
|||
void DelFile();
|
||||
void RenameFile();
|
||||
void ToggleFileSpeed();
|
||||
void TogglePCH();
|
||||
void ToggleIncludeable();
|
||||
|
||||
void AddNormalUses();
|
||||
|
|
|
|||
|
|
@ -927,15 +927,20 @@ void WorkspaceWork::FileMenu(Bar& menu)
|
|||
if(IsActiveFile()) {
|
||||
menu.Separator();
|
||||
String p = GetActiveFilePath();
|
||||
if(GetFileExt(p) == ".tpp" && IsFolder(p)) {
|
||||
String ext = GetFileExt(p);
|
||||
if(ext == ".tpp" && IsFolder(p)) {
|
||||
menu.Add("Includeable topic group", THISBACK(ToggleIncludeable))
|
||||
.Check(FileExists(AppendFileName(p, "all.i")));
|
||||
if(IsSvnDir(p))
|
||||
menu.Add("Svn Synchronize " + p, THISBACK1(SyncSvnDir, p));
|
||||
}
|
||||
else
|
||||
else {
|
||||
menu.Add("Optimize for speed", THISBACK(ToggleFileSpeed))
|
||||
.Check(ActiveFile().optimize_speed);
|
||||
if(IsHeaderExt(ext))
|
||||
menu.Add("Precompile header", THISBACK(TogglePCH))
|
||||
.Check(ActiveFile().pch);
|
||||
}
|
||||
}
|
||||
FilePropertiesMenu(menu);
|
||||
}
|
||||
|
|
@ -948,6 +953,14 @@ void WorkspaceWork::ToggleFileSpeed()
|
|||
}
|
||||
}
|
||||
|
||||
void WorkspaceWork::TogglePCH()
|
||||
{
|
||||
if(IsActiveFile()) {
|
||||
ActiveFile().pch = !ActiveFile().pch;
|
||||
SaveLoadPackageNS();
|
||||
}
|
||||
}
|
||||
|
||||
void WorkspaceWork::ToggleIncludeable()
|
||||
{
|
||||
if(IsActiveFile()) {
|
||||
|
|
|
|||
|
|
@ -25,8 +25,7 @@ link(WIN32 MSC) /MAP;
|
|||
|
||||
file
|
||||
IDE readonly separator,
|
||||
ide.h
|
||||
options() PCH,
|
||||
ide.h options PCH,
|
||||
version.h,
|
||||
UppDlg.h,
|
||||
BaseDlg.cpp,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue