cmBuildOptions.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. file Copyright.txt or https://cmake.org/licensing for details. */
  3. #pragma once
  4. #include "cmConfigure.h" // IWYU pragma: keep
  5. /** \brief Defines how to resolve packages **/
  6. enum class PackageResolveMode
  7. {
  8. /** \brief Defines behavior based on cache variable (e.g.
  9. CMAKE_VS_NUGET_PACKAGE_RESTORE). This is the default. **/
  10. FromCacheVariable,
  11. /** \brief Ignore behavior defined by cache variable and forces packages to
  12. be resolved prior to build. **/
  13. Force,
  14. /** \brief Ignore behavior defined by cache variable and forces packages to
  15. be resolved, but skip the actual build. **/
  16. OnlyResolve,
  17. /** \brief Ignore behavior defined by cache variable and dont resolve any
  18. packages **/
  19. Disable
  20. };
  21. struct cmBuildOptions
  22. {
  23. public:
  24. cmBuildOptions() noexcept = default;
  25. explicit cmBuildOptions(bool clean, bool fast,
  26. PackageResolveMode resolveMode) noexcept
  27. : Clean(clean)
  28. , Fast(fast)
  29. , ResolveMode(resolveMode)
  30. {
  31. }
  32. explicit cmBuildOptions(const cmBuildOptions&) noexcept = default;
  33. cmBuildOptions& operator=(const cmBuildOptions&) noexcept = default;
  34. bool Clean = false;
  35. bool Fast = false;
  36. PackageResolveMode ResolveMode = PackageResolveMode::FromCacheVariable;
  37. };