main.cpp 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #include "AssetBuilderApplication.h"
  9. #include "TraceMessageHook.h"
  10. #include "AssetBuilderComponent.h"
  11. int main(int argc, char** argv)
  12. {
  13. const AZ::Debug::Trace tracer;
  14. AssetBuilderApplication app(&argc, &argv);
  15. AssetBuilder::TraceMessageHook traceMessageHook; // Hook AZ Debug messages and redirect them to stdout
  16. traceMessageHook.EnableTraceContext(true);
  17. AZ::Debug::Trace::HandleExceptions(true);
  18. AZ::ComponentApplication::StartupParameters startupParams;
  19. startupParams.m_loadDynamicModules = false;
  20. app.Start(AzFramework::Application::Descriptor(), startupParams);
  21. traceMessageHook.EnableDebugMode(app.IsInDebugMode());
  22. bool result = false;
  23. BuilderBus::BroadcastResult(result, &BuilderBus::Events::Run);
  24. traceMessageHook.EnableTraceContext(false);
  25. app.Stop();
  26. return result ? 0 : 1;
  27. }