Drop Visual Studio 14 2015 generator

This generator has been deprecated since CMake 4.2.  Remove it.
This commit is contained in:
Brad King
2026-07-03 11:53:32 -04:00
parent 1514097505
commit 5b0aee4961
26 changed files with 26 additions and 418 deletions
+6 -74
View File
@@ -1,77 +1,9 @@
Visual Studio 14 2015
---------------------
.. deprecated:: 4.2
This generator is deprecated and will be removed in a future version
of CMake. It will still be possible to build with VS 14 2015 tools
using the :generator:`Visual Studio 15 2017` (or above) generator
with :variable:`CMAKE_GENERATOR_TOOLSET` set to ``v140``, or by
using the :generator:`NMake Makefiles` generator.
.. versionadded:: 3.1
Generates Visual Studio 14 (VS 2015) project files.
Project Types
^^^^^^^^^^^^^
Only Visual C++ and C# projects may be generated (and Fortran with
Intel compiler integration). Other types of projects (JavaScript,
Powershell, Python, etc.) are not supported.
Platform Selection
^^^^^^^^^^^^^^^^^^
The default target platform name (architecture) is ``Win32``.
The :variable:`CMAKE_GENERATOR_PLATFORM` variable may be set, perhaps
via the :option:`cmake -A` option, to specify a target platform
name (architecture). For example:
* ``cmake -G "Visual Studio 14 2015" -A Win32``
* ``cmake -G "Visual Studio 14 2015" -A x64``
* ``cmake -G "Visual Studio 14 2015" -A ARM``
.. versionchanged:: 4.0
Previously, for compatibility with CMake versions prior to 3.1,
one could specify a target platform name optionally at the
end of the generator name. This has been removed.
This was supported only for:
``Visual Studio 14 2015 Win64``
Specify target platform ``x64``.
``Visual Studio 14 2015 ARM``
Specify target platform ``ARM``.
Toolset Selection
^^^^^^^^^^^^^^^^^
The ``v140`` toolset that comes with Visual Studio 14 2015 is selected by
default. The :variable:`CMAKE_GENERATOR_TOOLSET` option may be set, perhaps
via the :option:`cmake -T` option, to specify another toolset.
.. |VS_TOOLSET_HOST_ARCH_DEFAULT| replace::
By default this generator uses the 32-bit variant even on a 64-bit host.
.. include:: include/VS_TOOLSET_HOST_ARCH_LEGACY.rst
.. _`Windows 10 SDK Maximum Version for VS 2015`:
Windows 10 SDK Maximum Version for VS 2015
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. versionadded:: 3.19
Microsoft stated in a "Windows 10 October 2018 Update" blog post that Windows
10 SDK versions (15063, 16299, 17134, 17763) are not supported by VS 2015 and
are only supported by VS 2017 and later. Therefore by default CMake
automatically ignores Windows 10 SDKs beyond ``10.0.14393.0``.
However, there are other recommendations for certain driver/Win32 builds that
indicate otherwise. A user can override this behavior by either setting the
:variable:`CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION_MAXIMUM` to a false value
or setting the :variable:`CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION_MAXIMUM` to
the string value of the required maximum (e.g. ``10.0.15063.0``).
Removed. This once generated Visual Studio 14 2015 project files, but
the generator has been removed since CMake 4.5. It is still possible
to build with the VS 14 2015 toolset by also installing VS 2017 (or above)
and using the :generator:`Visual Studio 15 2017` (or above) generator with
:variable:`CMAKE_GENERATOR_TOOLSET` set to ``v140``,
or by using the :generator:`NMake Makefiles` generator.
@@ -0,0 +1,4 @@
remove-vs14-generator
---------------------
* The :generator:`Visual Studio 14 2015` generator has been removed.
@@ -1,7 +1,7 @@
CMAKE_VS_INTEL_Fortran_PROJECT_VERSION
--------------------------------------
When generating for :generator:`Visual Studio 14 2015` or greater with the Intel
Fortran plugin installed, this specifies the ``.vfproj`` project file format
version. This is intended for internal use by CMake and should not be
used by project code.
When using :ref:`Visual Studio Generators` with the Intel Fortran plugin
installed, this specifies the ``.vfproj`` project file format version.
This is intended for internal use by CMake and should not be used by
project code.
@@ -3,7 +3,7 @@ CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION_MAXIMUM
.. versionadded:: 3.19
Override the :ref:`Windows 10 SDK Maximum Version for VS 2015` and beyond.
Override the Windows 10 SDK Maximum Version.
The ``CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION_MAXIMUM`` variable may
be set to a false value (e.g. ``OFF``, ``FALSE``, or ``0``) or the SDK version
-6
View File
@@ -2563,12 +2563,6 @@ int cmGlobalGenerator::Build(cmBuildArgs const& buildArgs,
realConfig, buildArgs.jobs, buildArgs.verbose, buildOptions, nativeOptions,
isInTryCompile);
// Workaround to convince some commands to produce output.
if (outputMode == cmSystemTools::OUTPUT_PASSTHROUGH &&
makeCommand.back().RequiresOutputForward) {
outputMode = cmSystemTools::OUTPUT_FORWARD;
}
// should we do a clean first?
if (buildOptions.Clean) {
std::vector<GeneratedMakeCommand> cleanCommand =
-1
View File
@@ -99,7 +99,6 @@ struct GeneratedMakeCommand
std::string QuotedPrintable() const;
std::vector<std::string> PrimaryCommand;
bool RequiresOutputForward = false;
};
}
namespace Json {
+1 -23
View File
@@ -876,20 +876,6 @@ std::string cmGlobalVisualStudio10Generator::FindMSBuildCommand()
return msbuild;
}
std::string cmGlobalVisualStudio10Generator::FindDevEnvCommand()
{
if (this->ExpressEdition) {
// Visual Studio Express >= 10 do not have "devenv.com" or
// "VCExpress.exe" that we can use to build reliably.
// Tell the caller it needs to use MSBuild instead.
return "";
}
// Skip over the cmGlobalVisualStudio8Generator implementation because
// we expect a real devenv and do not want to look for VCExpress.
// NOLINTNEXTLINE(bugprone-parent-virtual-call)
return this->cmGlobalVisualStudio7Generator::FindDevEnvCommand();
}
bool cmGlobalVisualStudio10Generator::FindVCTargetsPath(cmMakefile* mf)
{
// Skip this in special cases within our own test suite.
@@ -1089,12 +1075,7 @@ cmGlobalVisualStudio10Generator::GenerateBuildCommand(
// Check if the caller explicitly requested a devenv tool.
std::string makeProgramLower = makeProgramSelected;
cmSystemTools::LowerCase(makeProgramLower);
bool useDevEnv = (makeProgramLower.find("devenv") != std::string::npos ||
makeProgramLower.find("vcexpress") != std::string::npos);
// Workaround to convince VCExpress.exe to produce output.
bool const requiresOutputForward =
(makeProgramLower.find("vcexpress") != std::string::npos);
bool useDevEnv = makeProgramLower.find("devenv") != std::string::npos;
// MSBuild is preferred (and required for VS Express), but if the .sln has
// an Intel Fortran .vfproj then we have to use devenv. Parse it to find out.
@@ -1144,7 +1125,6 @@ cmGlobalVisualStudio10Generator::GenerateBuildCommand(
}
GeneratedMakeCommand makeCommand;
makeCommand.RequiresOutputForward = requiresOutputForward;
makeCommand.Add(makeProgramSelected);
if (tname == "clean"_s) {
@@ -1289,8 +1269,6 @@ std::string cmGlobalVisualStudio10Generator::Encoding()
char const* cmGlobalVisualStudio10Generator::GetToolsVersion() const
{
switch (this->Version) {
case cmGlobalVisualStudioGenerator::VSVersion::VS14:
return "14.0";
case cmGlobalVisualStudioGenerator::VSVersion::VS15:
return "15.0";
case cmGlobalVisualStudioGenerator::VSVersion::VS16:
-1
View File
@@ -273,7 +273,6 @@ private:
std::string MSBuildCommand;
std::set<std::string> AndroidExecutableWarnings;
virtual std::string FindMSBuildCommand();
std::string FindDevEnvCommand() override;
std::string GetVSMakeProgram() override { return this->GetMSBuildCommand(); }
std::string GeneratorToolsetVersion;
-107
View File
@@ -9,7 +9,6 @@
#include <cmext/string_view>
#include "cmGlobalGenerator.h"
#include "cmGlobalGeneratorFactory.h"
#include "cmGlobalVisualStudioGenerator.h"
#include "cmMakefile.h"
#include "cmMessageType.h"
@@ -18,105 +17,10 @@
#include "cmSystemTools.h"
#include "cmValue.h"
static char const vs14generatorName[] = "Visual Studio 14 2015";
// Map generator name without year to name with year.
static char const* cmVS14GenName(std::string const& name, std::string& genName)
{
if (strncmp(name.c_str(), vs14generatorName,
sizeof(vs14generatorName) - 6) != 0) {
return nullptr;
}
char const* p = name.c_str() + sizeof(vs14generatorName) - 6;
if (cmHasLiteralPrefix(p, " 2015")) {
p += 5;
}
genName = std::string(vs14generatorName) + p;
return p;
}
class cmGlobalVisualStudio14Generator::Factory
: public cmGlobalGeneratorFactory
{
public:
std::unique_ptr<cmGlobalGenerator> CreateGlobalGenerator(
std::string const& name, cmake* cm) const override
{
std::string genName;
char const* p = cmVS14GenName(name, genName);
if (!p) {
return std::unique_ptr<cmGlobalGenerator>();
}
if (!*p) {
return std::unique_ptr<cmGlobalGenerator>(
new cmGlobalVisualStudio14Generator(cm, genName));
}
return std::unique_ptr<cmGlobalGenerator>();
}
cmDocumentationEntry GetDocumentation() const override
{
return { std::string(vs14generatorName),
"Deprecated. Generates Visual Studio 2015 project files. "
"Use -A option to specify architecture." };
}
std::vector<std::string> GetGeneratorNames() const override
{
std::vector<std::string> names;
names.push_back(vs14generatorName);
return names;
}
bool SupportsToolset() const override { return true; }
bool SupportsPlatform() const override { return true; }
std::vector<std::string> GetKnownPlatforms() const override
{
std::vector<std::string> platforms;
platforms.emplace_back("x64");
platforms.emplace_back("Win32");
platforms.emplace_back("ARM");
return platforms;
}
std::string GetDefaultPlatformName() const override { return "Win32"; }
};
std::unique_ptr<cmGlobalGeneratorFactory>
cmGlobalVisualStudio14Generator::NewFactory()
{
return std::unique_ptr<cmGlobalGeneratorFactory>(new Factory);
}
cmGlobalVisualStudio14Generator::cmGlobalVisualStudio14Generator(
cmake* cm, std::string const& name)
: cmGlobalVisualStudio12Generator(cm, name)
{
std::string vc14Express;
this->ExpressEdition = cmSystemTools::ReadRegistryValue(
"HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\14.0\\Setup\\VC;"
"ProductDir",
vc14Express, cmSystemTools::KeyWOW64_32);
this->DefaultPlatformToolset = "v140";
this->DefaultAndroidToolset = "Clang_3_8";
this->DefaultCLFlagTableName = "v140";
this->DefaultCSharpFlagTableName = "v140";
this->DefaultLibFlagTableName = "v14";
this->DefaultLinkFlagTableName = "v140";
this->DefaultMasmFlagTableName = "v14";
this->DefaultRCFlagTableName = "v14";
this->Version = VSVersion::VS14;
}
bool cmGlobalVisualStudio14Generator::MatchesGeneratorName(
std::string const& name) const
{
std::string genName;
if (cmVS14GenName(name, genName)) {
return genName == this->GetName();
}
return false;
}
bool cmGlobalVisualStudio14Generator::InitializePlatformWindows(cmMakefile* mf)
@@ -383,17 +287,6 @@ std::string cmGlobalVisualStudio14Generator::GetWindows10SDKMaxVersion(
return this->GetWindows10SDKMaxVersionDefault(mf);
}
std::string cmGlobalVisualStudio14Generator::GetWindows10SDKMaxVersionDefault(
cmMakefile*) const
{
// The last Windows 10 SDK version that VS 2015 can target is 10.0.14393.0.
//
// "VS 2015 Users: The Windows 10 SDK (15063, 16299, 17134, 17763) is
// officially only supported for VS 2017." From:
// https://blogs.msdn.microsoft.com/chuckw/2018/10/02/windows-10-october-2018-update/
return "10.0.14393.0";
}
#if defined(_WIN32) && !defined(__CYGWIN__)
struct NoWindowsH
{
+2 -9
View File
@@ -11,7 +11,6 @@
#include "cmGlobalVisualStudio12Generator.h"
class cmGlobalGeneratorFactory;
class cmMakefile;
class cmake;
@@ -19,10 +18,6 @@ class cmake;
class cmGlobalVisualStudio14Generator : public cmGlobalVisualStudio12Generator
{
public:
static std::unique_ptr<cmGlobalGeneratorFactory> NewFactory();
bool MatchesGeneratorName(std::string const& name) const override;
char const* GetAndroidApplicationTypeRevision() const override
{
return "2.0";
@@ -53,7 +48,8 @@ protected:
// Used to make sure that the Windows 10 SDK selected can work with the
// version of the toolset.
virtual std::string GetWindows10SDKMaxVersionDefault(cmMakefile* mf) const;
virtual std::string GetWindows10SDKMaxVersionDefault(
cmMakefile* mf) const = 0;
virtual bool SelectWindows10SDK(cmMakefile* mf);
@@ -67,8 +63,5 @@ protected:
std::string GetWindows10SDKVersion(cmMakefile* mf);
private:
class Factory;
friend class Factory;
cm::optional<std::string> GeneratorPlatformVersion;
};
-37
View File
@@ -140,39 +140,6 @@ std::string const& cmGlobalVisualStudio7Generator::GetDevEnvCommand()
return this->DevEnvCommand;
}
std::string cmGlobalVisualStudio7Generator::FindDevEnvCommand()
{
std::string vscmd;
std::string vskey;
// Search in standard location.
vskey = cmStrCat(this->GetRegistryBase(), ";InstallDir");
if (cmSystemTools::ReadRegistryValue(vskey, vscmd,
cmSystemTools::KeyWOW64_32)) {
cmSystemTools::ConvertToUnixSlashes(vscmd);
vscmd += "/devenv.com";
if (cmSystemTools::FileExists(vscmd, true)) {
return vscmd;
}
}
// Search where VS15Preview places it.
vskey =
cmStrCat(R"(HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\SxS\VS7;)",
this->GetIDEVersion());
if (cmSystemTools::ReadRegistryValue(vskey, vscmd,
cmSystemTools::KeyWOW64_32)) {
cmSystemTools::ConvertToUnixSlashes(vscmd);
vscmd += "/Common7/IDE/devenv.com";
if (cmSystemTools::FileExists(vscmd, true)) {
return vscmd;
}
}
vscmd = "devenv.com";
return vscmd;
}
std::vector<cmGlobalGenerator::GeneratedMakeCommand>
cmGlobalVisualStudio7Generator::GenerateBuildCommand(
std::string const& makeProgram, std::string const& projectName,
@@ -196,9 +163,6 @@ cmGlobalVisualStudio7Generator::GenerateBuildCommand(
makeProgramSelected = this->GetDevEnvCommand();
}
// Workaround to convince VCExpress.exe to produce output.
bool const requiresOutputForward =
(makeProgramLower.find("vcexpress") != std::string::npos);
std::vector<GeneratedMakeCommand> makeCommands;
std::vector<std::string> realTargetNames = targetNames;
@@ -219,7 +183,6 @@ cmGlobalVisualStudio7Generator::GenerateBuildCommand(
realTarget = "ALL_BUILD";
}
GeneratedMakeCommand makeCommand;
makeCommand.RequiresOutputForward = requiresOutputForward;
makeCommand.Add(makeProgramSelected);
makeCommand.Add(slnFile);
makeCommand.Add((clean ? "/clean" : "/build"));
+1 -1
View File
@@ -119,7 +119,7 @@ protected:
cmGlobalVisualStudio7Generator(cmake* cm);
std::string const& GetDevEnvCommand();
virtual std::string FindDevEnvCommand();
virtual std::string FindDevEnvCommand() = 0;
bool MarmasmEnabled;
bool MasmEnabled;
-17
View File
@@ -47,23 +47,6 @@ cmGlobalVisualStudio8Generator::cmGlobalVisualStudio8Generator(
cmGlobalVisualStudio8Generator::GetExtraFlagTableVS8();
}
std::string cmGlobalVisualStudio8Generator::FindDevEnvCommand()
{
// First look for VCExpress.
std::string vsxcmd;
std::string vsxkey =
cmStrCat(R"(HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VCExpress\)",
this->GetIDEVersion(), ";InstallDir");
if (cmSystemTools::ReadRegistryValue(vsxkey, vsxcmd,
cmSystemTools::KeyWOW64_32)) {
cmSystemTools::ConvertToUnixSlashes(vsxcmd);
vsxcmd += "/VCExpress.exe";
return vsxcmd;
}
// Now look for devenv.
return this->cmGlobalVisualStudio7Generator::FindDevEnvCommand();
}
void cmGlobalVisualStudio8Generator::EnableLanguage(
std::vector<std::string> const& lang, cmMakefile* mf, bool optional)
{
-2
View File
@@ -58,8 +58,6 @@ protected:
void AddExtraIDETargets() override;
std::string FindDevEnvCommand() override;
bool VSLinksDependencies() const override { return false; }
bool AddCheckTarget();
-24
View File
@@ -111,8 +111,6 @@ std::string const& cmGlobalVisualStudioGenerator::GetPlatformName() const
char const* cmGlobalVisualStudioGenerator::GetIDEVersion() const
{
switch (this->Version) {
case cmGlobalVisualStudioGenerator::VSVersion::VS14:
return "14.0";
case cmGlobalVisualStudioGenerator::VSVersion::VS15:
return "15.0";
case cmGlobalVisualStudioGenerator::VSVersion::VS16:
@@ -930,8 +928,6 @@ cm::VS::Solution cmGlobalVisualStudioGenerator::CreateSolution(
using namespace cm::VS;
Solution solution;
solution.VSVersion = this->Version;
solution.VSExpress =
this->ExpressEdition ? VersionExpress::Yes : VersionExpress::No;
solution.Platform = this->GetPlatformName();
solution.Configs =
root->GetMakefile()->GetGeneratorConfigs(cmMakefile::ExcludeEmptyConfig);
@@ -1176,26 +1172,6 @@ void cmGlobalVisualStudioGenerator::Generate()
this->CallVisualStudioMacro(MacroReload,
GetSLNFile(this->LocalGenerators[0].get()));
}
if (this->Version == VSVersion::VS14 &&
!this->CMakeInstance->GetIsInTryCompile()) {
std::string cmakeWarnVS14;
if (cmValue cached = this->CMakeInstance->GetState()->GetCacheEntryValue(
"CMAKE_WARN_VS14")) {
this->CMakeInstance->MarkCliAsUsed("CMAKE_WARN_VS14");
cmakeWarnVS14 = *cached;
} else {
cmSystemTools::GetEnv("CMAKE_WARN_VS14", cmakeWarnVS14);
}
if (cmakeWarnVS14.empty() || !cmIsOff(cmakeWarnVS14)) {
this->CMakeInstance->IssueMessage(
MessageType::WARNING,
"The \"Visual Studio 14 2015\" generator is deprecated "
"and will be removed in a future version of CMake."
"\n"
"Add CMAKE_WARN_VS14=OFF to the cache to disable this warning.");
}
}
}
void cmGlobalVisualStudioGenerator::GenerateSolution(
-4
View File
@@ -40,9 +40,6 @@ public:
VSVersion GetVersion() const;
void SetVersion(VSVersion v);
/** Is the installed VS an Express edition? */
bool IsExpressEdition() const { return this->ExpressEdition; }
void EnableLanguage(std::vector<std::string> const& languages, cmMakefile*,
bool optional) override;
@@ -171,7 +168,6 @@ protected:
char const* GetIDEVersion() const;
VSVersion Version;
bool ExpressEdition;
std::string GeneratorPlatform;
std::string DefaultPlatformName;
@@ -126,8 +126,6 @@ static unsigned int VSVersionToMajor(
cmGlobalVisualStudioGenerator::VSVersion v)
{
switch (v) {
case cmGlobalVisualStudioGenerator::VSVersion::VS14:
return 14;
case cmGlobalVisualStudioGenerator::VSVersion::VS15:
return 15;
case cmGlobalVisualStudioGenerator::VSVersion::VS16:
@@ -144,8 +142,6 @@ static char const* VSVersionToToolset(
cmGlobalVisualStudioGenerator::VSVersion v)
{
switch (v) {
case cmGlobalVisualStudioGenerator::VSVersion::VS14:
return "v140";
case cmGlobalVisualStudioGenerator::VSVersion::VS15:
return "v141";
case cmGlobalVisualStudioGenerator::VSVersion::VS16:
@@ -162,8 +158,6 @@ static std::string VSVersionToMajorString(
cmGlobalVisualStudioGenerator::VSVersion v)
{
switch (v) {
case cmGlobalVisualStudioGenerator::VSVersion::VS14:
return "14";
case cmGlobalVisualStudioGenerator::VSVersion::VS15:
return "15";
case cmGlobalVisualStudioGenerator::VSVersion::VS16:
@@ -180,8 +174,6 @@ static char const* VSVersionToAndroidToolset(
cmGlobalVisualStudioGenerator::VSVersion v)
{
switch (v) {
case cmGlobalVisualStudioGenerator::VSVersion::VS14:
return "Clang_3_8";
case cmGlobalVisualStudioGenerator::VSVersion::VS15:
case cmGlobalVisualStudioGenerator::VSVersion::VS16:
case cmGlobalVisualStudioGenerator::VSVersion::VS17:
@@ -497,12 +489,14 @@ cmGlobalVisualStudioVersionedGenerator::cmGlobalVisualStudioVersionedGenerator(
, vsSetupAPIHelper(VSVersionToMajor(version))
{
this->Version = version;
this->ExpressEdition = false;
this->DefaultPlatformToolset = VSVersionToToolset(this->Version);
this->DefaultAndroidToolset = VSVersionToAndroidToolset(this->Version);
this->DefaultCLFlagTableName = VSVersionToToolset(this->Version);
this->DefaultCSharpFlagTableName = VSVersionToToolset(this->Version);
this->DefaultLibFlagTableName = "v14";
this->DefaultLinkFlagTableName = VSVersionToToolset(this->Version);
this->DefaultMasmFlagTableName = "v14";
this->DefaultRCFlagTableName = "v14";
if (this->Version >= cmGlobalVisualStudioGenerator::VSVersion::VS16) {
this->DefaultPlatformName = VSHostPlatformName();
this->DefaultPlatformToolsetHostArchitecture =
@@ -524,8 +518,6 @@ bool cmGlobalVisualStudioVersionedGenerator::MatchesGeneratorName(
{
std::string genName;
switch (this->Version) {
case cmGlobalVisualStudioGenerator::VSVersion::VS14:
break;
case cmGlobalVisualStudioGenerator::VSVersion::VS15:
if (cmVS15GenName(name, genName)) {
return genName == this->GetName();
@@ -795,8 +787,6 @@ cmGlobalVisualStudioVersionedGenerator::GetAndroidApplicationTypeRevision()
const
{
switch (this->Version) {
case cmGlobalVisualStudioGenerator::VSVersion::VS14:
return "2.0";
case cmGlobalVisualStudioGenerator::VSVersion::VS15:
case cmGlobalVisualStudioGenerator::VSVersion::VS16:
case cmGlobalVisualStudioGenerator::VSVersion::VS17:
+2 -12
View File
@@ -129,22 +129,13 @@ void Solution::CanonicalizeOrder()
namespace {
void WriteSlnHeader(std::ostream& sln, Version version, VersionExpress express)
void WriteSlnHeader(std::ostream& sln, Version version)
{
char utf8bom[] = { char(0xEF), char(0xBB), char(0xBF) };
sln.write(utf8bom, 3);
sln << '\n';
switch (version) {
case Version::VS14:
// Visual Studio 14 writes .sln format 12.00
sln << "Microsoft Visual Studio Solution File, Format Version 12.00\n";
if (express == VersionExpress::Yes) {
sln << "# Visual Studio Express 14 for Windows Desktop\n";
} else {
sln << "# Visual Studio 14\n";
}
break;
case Version::VS15:
// Visual Studio 15 writes .sln format 12.00
sln << "Microsoft Visual Studio Solution File, Format Version 12.00\n";
@@ -276,7 +267,6 @@ void WriteSlnPropertyGroup(std::ostream& sln,
void WriteSln(std::ostream& sln, Solution const& solution)
{
assert(solution.VSVersion);
assert(solution.VSExpress);
std::vector<Solution::Project const*> projects = solution.GetAllProjects();
std::sort(projects.begin(), projects.end(),
@@ -291,7 +281,7 @@ void WriteSln(std::ostream& sln, Solution const& solution)
return l->Name < r->Name;
});
WriteSlnHeader(sln, *solution.VSVersion, *solution.VSExpress);
WriteSlnHeader(sln, *solution.VSVersion);
for (Solution::Folder const* folder : solution.Folders) {
WriteSlnFolder(sln, *folder);
}
-3
View File
@@ -134,9 +134,6 @@ struct Solution final
/** Visual Studio major version number, if known. */
cm::optional<Version> VSVersion;
/** Whether this is a VS Express edition, if known. */
cm::optional<VersionExpress> VSExpress;
/** Solution-wide target platform. This is a Windows architecture. */
std::string Platform;
-7
View File
@@ -9,17 +9,10 @@ namespace VS {
/** Known versions of Visual Studio. */
enum class Version : std::uint16_t
{
VS14 = 140,
VS15 = 150,
VS16 = 160,
VS17 = 170,
VS18 = 180,
};
enum class VersionExpress
{
No,
Yes,
};
}
}
+1 -37
View File
@@ -108,7 +108,6 @@
# include "cmGlobalFastbuildGenerator.h"
# include "cmGlobalJOMMakefileGenerator.h"
# include "cmGlobalNMakeMakefileGenerator.h"
# include "cmGlobalVisualStudio14Generator.h"
# include "cmGlobalVisualStudioVersionedGenerator.h"
# include "cmVSSetupHelper.h"
@@ -2910,23 +2909,6 @@ std::unique_ptr<cmGlobalGenerator> cmake::EvaluateDefaultGlobalGenerator()
std::string found;
// Try to find the newest VS installed on the computer and
// use that as a default if -G is not specified
std::string const vsregBase = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\";
static char const* const vsVariants[] = {
/* clang-format needs this comment to break after the opening brace */
"VisualStudio\\", "VCExpress\\", "WDExpress\\"
};
struct VSVersionedGenerator
{
char const* MSVersion;
char const* GeneratorName;
};
static VSVersionedGenerator const vsGenerators[] = {
{ "14.0", "Visual Studio 14 2015" }, //
};
static char const* const vsEntries[] = {
"\\Setup\\VC;ProductDir", //
";InstallDir" //
};
if (cmVSSetupAPIHelper(18).IsVSInstalled()) {
found = "Visual Studio 18 2026";
} else if (cmVSSetupAPIHelper(17).IsVSInstalled()) {
@@ -2935,23 +2917,6 @@ std::unique_ptr<cmGlobalGenerator> cmake::EvaluateDefaultGlobalGenerator()
found = "Visual Studio 16 2019";
} else if (cmVSSetupAPIHelper(15).IsVSInstalled()) {
found = "Visual Studio 15 2017";
} else {
for (VSVersionedGenerator const* g = cm::cbegin(vsGenerators);
found.empty() && g != cm::cend(vsGenerators); ++g) {
for (char const* const* v = cm::cbegin(vsVariants);
found.empty() && v != cm::cend(vsVariants); ++v) {
for (char const* const* e = cm::cbegin(vsEntries);
found.empty() && e != cm::cend(vsEntries); ++e) {
std::string const reg = vsregBase + *v + g->MSVersion + *e;
std::string dir;
if (cmSystemTools::ReadRegistryValue(reg, dir,
cmSystemTools::KeyWOW64_32) &&
cmSystemTools::PathExists(dir)) {
found = g->GeneratorName;
}
}
}
}
}
auto gen = this->CreateGlobalGenerator(found);
if (!gen) {
@@ -3381,7 +3346,6 @@ void cmake::AddDefaultGenerators()
cmGlobalVisualStudioVersionedGenerator::NewFactory16());
this->Generators.push_back(
cmGlobalVisualStudioVersionedGenerator::NewFactory15());
this->Generators.push_back(cmGlobalVisualStudio14Generator::NewFactory());
this->Generators.push_back(cmGlobalBorlandMakefileGenerator::NewFactory());
this->Generators.push_back(cmGlobalNMakeMakefileGenerator::NewFactory());
this->Generators.push_back(cmGlobalJOMMakefileGenerator::NewFactory());
@@ -4117,7 +4081,7 @@ int cmake::Build(cmBuildArgs buildArgs, std::vector<std::string> targets,
// to limitations of the underlying build system.
std::string const stampList =
cmStrCat(cachePath, "/CMakeFiles/",
cmGlobalVisualStudio14Generator::GetGenerateStampList());
cmGlobalVisualStudioVersionedGenerator::GetGenerateStampList());
// Note that the stampList file only exists for VS generators.
if (cmSystemTools::FileExists(stampList) &&
+1 -23
View File
@@ -52,13 +52,6 @@ set(ENV{HOME} \"${TEST_HOME}\")
")
endif()
# Suppress generator deprecation warnings in test suite.
if(CMAKE_GENERATOR MATCHES "^Visual Studio 14 2015")
set(TEST_WARN_VS_CODE "set(ENV{CMAKE_WARN_VS14} OFF)")
else()
set(TEST_WARN_VS_CODE "")
endif()
# 3.9 or later provides a definitive answer to whether we are multi-config
# through a global property. Prior to 3.9, CMAKE_CONFIGURATION_TYPES being set
# is assumed to mean multi-config, but developers might modify it so it is
@@ -208,11 +201,9 @@ if(BUILD_TESTING)
endif()
if(WIN32)
set(reg_vs14 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\14.0;InstallDir]")
set(reg_ws10_0 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\14.0\\Setup\\Build Tools for Windows 10;srcPath]")
set(reg_tegra "[HKEY_LOCAL_MACHINE\\SOFTWARE\\NVIDIA Corporation\\Nsight Tegra;sdkRoot]")
set(reg_nasm "[HKEY_CURRENT_USER\\SOFTWARE\\nasm]")
foreach(reg IN ITEMS vs14 ws10_0 tegra nasm)
foreach(reg IN ITEMS ws10_0 nasm)
get_filename_component(r "${reg_${reg}}" ABSOLUTE)
if(IS_DIRECTORY "${r}" AND NOT "${r}" STREQUAL "/registry")
set(${reg} 1)
@@ -2284,11 +2275,6 @@ if(BUILD_TESTING)
add_test_VSWinStorePhone(vs15-store10_0-X64 "Visual Studio 15 2017" WindowsStore 10.0 x64)
add_test_VSWinStorePhone(vs15-store10_0-ARM64 "Visual Studio 15 2017" WindowsStore 10.0 ARM64)
endif()
if(vs14 AND ws10_0)
add_test_VSWinStorePhone(vs14-store10_0-X86 "Visual Studio 14 2015" WindowsStore 10.0 Win32)
add_test_VSWinStorePhone(vs14-store10_0-ARM "Visual Studio 14 2015" WindowsStore 10.0 ARM)
add_test_VSWinStorePhone(vs14-store10_0-X64 "Visual Studio 14 2015" WindowsStore 10.0 x64)
endif()
endif()
if(CMAKE_GENERATOR MATCHES "Visual Studio" AND nasm)
@@ -2410,14 +2396,6 @@ if(BUILD_TESTING)
)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/VSAndroid/${name}")
endmacro()
if(tegra AND NOT "${CMake_SOURCE_DIR};${CMake_BINARY_DIR}" MATCHES " ")
if(vs14)
add_test_VSAndroid(vs14 "Visual Studio 14 2015" "Tegra-Android")
endif()
endif()
if(vs14 AND CMake_TEST_ANDROID_VS14)
add_test_VSAndroid(vs14 "Visual Studio 14 2015" "ARM")
endif()
if(vs15 AND CMake_TEST_ANDROID_VS15)
add_test_VSAndroid(vs15 "Visual Studio 15 2017" "ARM")
endif()
@@ -1,5 +0,0 @@
^CMake Warning:
The "Visual Studio 14 2015" generator is deprecated and will be removed in
a future version of CMake\.
Add CMAKE_WARN_VS14=OFF to the cache to disable this warning\.$
@@ -1281,10 +1281,3 @@ if (WIN32 OR DEFINED ENV{HOME})
endif()
set(ENV{CMAKE_CONFIG_DIR} cmake_config_dir)
run_cmake_command(print-config-dir-env ${CMAKE_COMMAND} "--print-config-dir")
if(RunCMake_GENERATOR MATCHES "^Visual Studio 14 2015")
run_cmake_with_options(DeprecateVS14-WARN-ON -DCMAKE_WARN_VS14=ON)
unset(ENV{CMAKE_WARN_VS14})
run_cmake(DeprecateVS14-WARN-ON)
run_cmake_with_options(DeprecateVS14-WARN-OFF -DCMAKE_WARN_VS14=OFF)
endif()