logic: Fixes and improvements for C/C++ compiler header path handling

* Always add compiler header path when prefilling on first start, regardless of successful detection
* Show compiler header path in path list box on top and readonly
* Prepend compiler header path on Windows in system header path compiler flags, append otherwise
* Show warning when saving ApplicationSettings if compiler header path is not in global include paths
* Show warning when saving ApplicationSettings if there is another path containing compiler headers
This commit is contained in:
Eberhard Graether
2019-01-21 15:18:31 +01:00
parent 3eb9211520
commit 7d30709306
13 changed files with 153 additions and 35 deletions
+1 -1
View File
@@ -34,5 +34,5 @@ FilePath ResourcePaths::getJavaPath()
FilePath ResourcePaths::getCxxCompilerHeaderPath()
{
return AppPath::getAppPath().concatenate(L"data/cxx/include/");
return AppPath::getAppPath().concatenate(L"data/cxx/include/").getCanonical();
}
+5 -12
View File
@@ -1,30 +1,23 @@
#include "utilityCxx.h"
#include "ResourcePaths.h"
#include "utilityApp.h"
namespace utility
{
std::vector<FilePath> replaceOrAddCxxCompilerHeaderPath(const std::vector<FilePath>& headerSearchPaths)
{
std::vector<FilePath> newHeaderSearchPaths;
const FilePath cxxCompilerHeaderPath = ResourcePaths::getCxxCompilerHeaderPath();
if (utility::getOsType() == OS_WINDOWS)
for (const FilePath& path : headerSearchPaths)
{
newHeaderSearchPaths = headerSearchPaths;
}
else
{
for (const FilePath& path : headerSearchPaths)
if (path != cxxCompilerHeaderPath)
{
if (!path.getConcatenated(L"/stdarg.h").exists())
{
newHeaderSearchPaths.push_back(path);
}
newHeaderSearchPaths.push_back(path);
}
}
newHeaderSearchPaths.push_back(ResourcePaths::getCxxCompilerHeaderPath().getCanonical());
newHeaderSearchPaths.push_back(cxxCompilerHeaderPath);
return newHeaderSearchPaths;
}
}