Builds Windows nounity and unity

Builds Linux nounity and unity

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
This commit is contained in:
Esteban Papp
2021-07-16 13:13:59 -07:00
parent 032a35e495
commit 7c9653087d
45 changed files with 77 additions and 146 deletions
@@ -8,3 +8,16 @@
#pragma once
#include <unistd.h>
#define __STDC_FORMAT_MACROS
#include <inttypes.h>
// types like AZ::u64 require an usigned long long, but inttypes.h has it as unsigned long
#undef PRIX64
#undef PRIx64
#undef PRId64
#undef PRIu64
#define PRIX64 "llX"
#define PRIx64 "llx"
#define PRId64 "lld"
#define PRIu64 "llu"
@@ -7,6 +7,7 @@
#pragma once
#include "time_UnixLike.h"
#include <AzCore/std/chrono/clocks.h>
/**
* This file is to be included from the semaphore.h only. It should NOT be included by the user.
@@ -4,10 +4,8 @@
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
#include <stdlib.h>
#include <windows.h>
#include <sysinfoapi.h>
#include <fileapi.h>
#include <AzCore/PlatformIncl.h>
#include <AzCore/IO/Path/Path.h>
#include <AzCore/std/functional.h>
@@ -214,9 +214,7 @@ namespace LegacyFramework
/** (Windows) retrieves the main module of the executable.
* This is always going to be the main executable except in the situation where the framework may be running as a DLL belonging to another process or program.
*/
#ifdef AZ_PLATFORM_WINDOWS
virtual HMODULE GetMainModule() = 0;
#endif
virtual void* GetMainModule() = 0;
virtual const char* GetApplicationName() = 0;
virtual const char* GetApplicationModule() = 0;
@@ -57,7 +57,7 @@ AZ_POP_DISABLE_OVERRIDE_WARNING
namespace LegacyFramework
{
ApplicationDesc::ApplicationDesc(const char* name, int argc, char** argv)
: m_applicationModule(NULL)
: m_applicationModule(nullptr)
, m_enableGridmate(true)
, m_enablePerforce(true)
, m_enableGUI(true)
@@ -70,7 +70,7 @@ namespace LegacyFramework
m_applicationName[0] = 0;
if (name)
{
azstrcpy(m_applicationName, _MAX_PATH, name);
azstrcpy(m_applicationName, AZ_MAX_PATH_LEN, name);
}
}
@@ -90,7 +90,7 @@ namespace LegacyFramework
m_enableGUI = other.m_enableGUI;
m_enableGridmate = other.m_enableGridmate;
m_enablePerforce = other.m_enablePerforce;
azstrcpy(m_applicationName, _MAX_PATH, other.m_applicationName);
azstrcpy(m_applicationName, AZ_MAX_PATH_LEN, other.m_applicationName);
m_enableProjectManager = other.m_enableProjectManager;
m_shouldRunAssetProcessor = other.m_shouldRunAssetProcessor;
m_saveUserSettings = other.m_saveUserSettings;
@@ -104,12 +104,12 @@ namespace LegacyFramework
m_isPrimary = true;
m_desiredExitCode = 0;
m_abortRequested = false;
m_applicationEntity = NULL;
m_ptrSystemEntity = NULL;
m_applicationEntity = nullptr;
m_ptrSystemEntity = nullptr;
m_applicationModule[0] = 0;
}
HMODULE Application::GetMainModule()
void* Application::GetMainModule()
{
return m_desc.m_applicationModule;
}
@@ -371,7 +371,7 @@ namespace LegacyFramework
applicationFilePath.append("_app.xml");
AZ_Assert(applicationFilePath.size() <= _MAX_PATH, "Application path longer than expected");
AZ_Assert(applicationFilePath.size() <= AZ_MAX_PATH_LEN, "Application path longer than expected");
qstrcpy(m_applicationFilePath, applicationFilePath.c_str());
// load all application entities, if present:
@@ -24,7 +24,7 @@ namespace LegacyFramework
{
struct ApplicationDesc
{
HMODULE m_applicationModule; // only necessary if you want to attach your application as a DLL plugin to another application, hosting it
void* m_applicationModule; // only necessary if you want to attach your application as a DLL plugin to another application, hosting it
bool m_enableGUI; // false if you want none of the QT or GUI functionality to exist. You cannot use project manager if you do this.
bool m_enableGridmate; // false if you want to not activate the network communications module.
bool m_enablePerforce; // false if you want to not activate perforce SCM integration. note that this will eventually become a plugin anyway
@@ -35,7 +35,7 @@ namespace LegacyFramework
int m_argc;
char** m_argv;
char m_applicationName[_MAX_PATH];
char m_applicationName[AZ_MAX_PATH_LEN];
ApplicationDesc(const char* name = "Application", int argc = 0, char** argv = nullptr);
ApplicationDesc(const ApplicationDesc& other);
@@ -65,7 +65,7 @@ namespace LegacyFramework
virtual bool IsRunningInGUIMode() { return m_desc.m_enableGUI; }
virtual bool RequiresGameProject() { return m_desc.m_enableProjectManager; }
virtual bool ShouldRunAssetProcessor() { return m_desc.m_shouldRunAssetProcessor; }
virtual HMODULE GetMainModule();
virtual void* GetMainModule();
virtual const char* GetApplicationName();
virtual const char* GetApplicationModule();
virtual const char* GetApplicationDirectory();
@@ -131,11 +131,11 @@ namespace LegacyFramework
void CreateApplicationComponent();
void SaveApplicationEntity();
char m_applicationModule[_MAX_PATH];
char m_applicationModule[AZ_MAX_PATH_LEN];
int m_desiredExitCode;
bool m_isPrimary;
volatile bool m_abortRequested; // if you CTRL+C in a console app, this becomes true. its up to you to check...
char m_applicationFilePath[_MAX_PATH];
char m_applicationFilePath[AZ_MAX_PATH_LEN];
ApplicationDesc m_desc;
AzFramework::CommandLine* m_ptrCommandLineParser;
};
@@ -48,32 +48,6 @@ namespace AzToolsFramework
};
}
static QWindow* windowForWidget(const QWidget* widget)
{
QWindow* window = widget->windowHandle();
if (window)
{
return window;
}
const QWidget* nativeParent = widget->nativeParentWidget();
if (nativeParent)
{
return nativeParent->windowHandle();
}
return 0;
}
HWND getHWNDForWidget(const QWidget* widget)
{
QWindow* window = windowForWidget(widget);
if (window && window->handle())
{
QPlatformNativeInterface* itf = QGuiApplication::platformNativeInterface();
return static_cast<HWND>(itf->nativeResourceForWindow(QByteArrayLiteral("handle"), window));
}
return 0;
}
bool GetOverwritePromptResult(QWidget* pParentWidget, const char* assetNameToOvewrite)
{
OverwritePromptDialog dlg(pParentWidget);
@@ -51,9 +51,6 @@ namespace AzToolsFramework
// ------------------------------------------------ DESCRIPTOR STRUCTS ----------------------------------------------------
// ------------------------------------------------------------------------------------------------------------------------
// helper function:
HWND getHWNDForWidget(const QWidget* widget);
struct HotkeyDescription
{
enum Scope
@@ -7,6 +7,7 @@
#pragma once
#include <AzCore/Memory/Memory.h>
#include <AzCore/std/function/function_template.h>
#include <AzCore/std/containers/unordered_map.h>
#include <QPointer>