Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

75 lines
2.4 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Interface for makefiles to build differently depending on where they are run from
  4. //
  5. //===========================================================================//
  6. #ifndef IDMEMAKEFILEUTILS_H
  7. #define IDMEMAKEFILEUTILS_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "appframework/IAppSystem.h"
  12. #include "vstdlib/iprocessutils.h"
  13. //-----------------------------------------------------------------------------
  14. // Forward declarations
  15. //-----------------------------------------------------------------------------
  16. class CDmElement;
  17. //-----------------------------------------------------------------------------
  18. // Interface version
  19. //-----------------------------------------------------------------------------
  20. #define DMEMAKEFILE_UTILS_INTERFACE_VERSION "VDmeMakeFileUtils001"
  21. //-----------------------------------------------------------------------------
  22. // Interface for makefiles to build differently depending on where they are run from
  23. //-----------------------------------------------------------------------------
  24. enum CompilationState_t
  25. {
  26. COMPILATION_SUCCESSFUL = 0,
  27. COMPILATION_NOT_COMPLETE,
  28. COMPILATION_FAILED,
  29. };
  30. abstract_class IDmeMakefileUtils : public IAppSystem
  31. {
  32. public:
  33. // Methods related to compilation
  34. virtual void PerformCompile( CDmElement *pElement, bool bBuildAllDependencies ) = 0;
  35. // Are we in the middle of compiling something?
  36. virtual bool IsCurrentlyCompiling( ) = 0;
  37. // Returns the size of the buffer to pass into UpdateCompilation()
  38. virtual int GetCompileOutputSize() = 0;
  39. // Updates the compilation
  40. virtual CompilationState_t UpdateCompilation( char *pOutputBuf, int nBufLen ) = 0;
  41. // Aborts the compilation
  42. virtual void AbortCurrentCompilation() = 0;
  43. // Opens an external editor for this element
  44. virtual void PerformOpenEditor( CDmElement *pElement ) = 0;
  45. // Returns the exit code of the failed compilation (if COMPILATION_FAILED occurred)
  46. virtual int GetExitCode() = 0;
  47. // Somewhere in here, we need a method of populating choice lists
  48. // for things like choosing vstInfoNodes to export for DCC makefiles
  49. };
  50. //-----------------------------------------------------------------------------
  51. // Default implementation
  52. //-----------------------------------------------------------------------------
  53. IDmeMakefileUtils* GetDefaultDmeMakefileUtils();
  54. #endif // IDMEMAKEFILEUTILS_H