Fixes for Linux no unity builds

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
This commit is contained in:
Esteban Papp
2022-01-21 16:42:30 -08:00
parent fd4014b278
commit 4d62351628
10 changed files with 61 additions and 3 deletions
@@ -0,0 +1,47 @@
/*
* Copyright (c) Contributors to the Open 3D Engine Project.
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
#include "ToolsFileUtils.h"
#include <sys/stat.h>
#include <utime.h>
#include <QStorageInfo>
namespace AzToolsFramework
{
namespace ToolsFileUtils
{
bool SetModificationTime(const char* const filename, AZ::u64 modificationTime)
{
struct stat statResult;
if (stat(filename, &statResult) != 0)
{
return false;
}
struct utimbuf puttime;
puttime.modtime = modificationTime;
puttime.actime = static_cast<AZ::u64>(statResult.st_ctime);
if (utime(filename, &puttime) == 0)
{
return true;
}
return false;
}
bool GetFreeDiskSpace(const QString& path, qint64& outFreeDiskSpace)
{
QStorageInfo storageInfo(path);
outFreeDiskSpace = storageInfo.bytesFree();
return outFreeDiskSpace >= 0;
}
}
}
@@ -18,7 +18,7 @@ AZ_PUSH_DISABLE_WARNING(4251, "-Wunknown-warning-option")
#include <QPainter>
AZ_POP_DISABLE_WARNING
#include <QtWidgets/QToolButton>
#include <QtGUI/QRegExpValidator>
#include <QtGui/QRegExpValidator>
namespace AzToolsFramework
{
@@ -29,4 +29,5 @@ set(FILES
UI/UICore/SaveChangesDialog.hxx
UI/UICore/SaveChangesDialog.cpp
UI/UICore/SaveChangesDialog.ui
ToolsFileUtils/ToolsFileUtils_generic.cpp
)
@@ -29,4 +29,5 @@ set(FILES
UI/UICore/SaveChangesDialog.hxx
UI/UICore/SaveChangesDialog.cpp
UI/UICore/SaveChangesDialog.ui
ToolsFileUtils/ToolsFileUtils_generic.cpp
)