1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-10-17 07:11:52 +08:00

VS: Factor out Visual Studio Version enumeration

This commit is contained in:
Brad King
2025-09-15 20:41:55 -04:00
parent 76266f9df6
commit d67e7d2726
3 changed files with 22 additions and 9 deletions

View File

@@ -975,6 +975,7 @@ if(WIN32)
cmVisualStudioWCEPlatformParser.cxx
cmVSSetupHelper.cxx
cmVSSetupHelper.h
cmVSVersion.h
)
# Add a manifest file to executables on Windows to allow for

View File

@@ -14,6 +14,7 @@
#include "cmGlobalGenerator.h"
#include "cmTargetDepend.h"
#include "cmVSVersion.h"
#include "cmValue.h"
class cmCustomCommand;
@@ -31,15 +32,7 @@ class cmake;
class cmGlobalVisualStudioGenerator : public cmGlobalGenerator
{
public:
/** Known versions of Visual Studio. */
enum class VSVersion : uint16_t
{
VS14 = 140,
VS15 = 150,
VS16 = 160,
VS17 = 170,
VS18 = 180,
};
using VSVersion = cm::VS::Version;
~cmGlobalVisualStudioGenerator() override;

19
Source/cmVSVersion.h Normal file
View File

@@ -0,0 +1,19 @@
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file LICENSE.rst or https://cmake.org/licensing for details. */
#pragma once
#include <cstdint>
namespace cm {
namespace VS {
/** Known versions of Visual Studio. */
enum class Version : std::uint16_t
{
VS14 = 140,
VS15 = 150,
VS16 = 160,
VS17 = 170,
VS18 = 180,
};
}
}