cmake/Source/cmGlobalVisualStudio7Generator.h

176 lines
6.2 KiB
C
Raw Normal View History

2016-10-30 18:24:19 +01:00
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
2021-09-14 00:13:48 +02:00
#pragma once
2020-08-30 11:54:41 +02:00
#include <memory>
2013-03-16 19:13:01 +02:00
#include "cmGlobalGeneratorFactory.h"
2020-02-01 23:06:01 +01:00
#include "cmGlobalVisualStudioGenerator.h"
class cmTarget;
2009-10-04 10:30:41 +03:00
struct cmIDEFlagTable;
/** \class cmGlobalVisualStudio7Generator
* \brief Write a Unix makefiles.
*
* cmGlobalVisualStudio7Generator manages UNIX build process for a tree
*/
class cmGlobalVisualStudio7Generator : public cmGlobalVisualStudioGenerator
{
public:
2014-08-03 19:52:23 +02:00
~cmGlobalVisualStudio7Generator();
2019-11-11 23:01:05 +01:00
//! Create a local generator appropriate to this Global Generator
2020-08-30 11:54:41 +02:00
std::unique_ptr<cmLocalGenerator> CreateLocalGenerator(
cmMakefile* mf) override;
2020-02-01 23:06:01 +01:00
#if !defined(CMAKE_BOOTSTRAP)
2019-11-11 23:01:05 +01:00
Json::Value GetJson() const override;
#endif
2015-04-27 22:25:09 +02:00
2019-11-11 23:01:05 +01:00
bool SetSystemName(std::string const& s, cmMakefile* mf) override;
2013-11-03 12:27:13 +02:00
2016-03-13 13:35:51 +01:00
/**
* Utilized by the generator factory to determine if this generator
* supports toolsets.
*/
static bool SupportsToolset() { return false; }
2016-10-30 18:24:19 +01:00
/**
* Utilized by the generator factory to determine if this generator
* supports platforms.
*/
static bool SupportsPlatform() { return false; }
/**
2015-04-27 22:25:09 +02:00
* Try to determine system information such as shared library
2012-02-18 12:40:36 +02:00
* extension, pthreads, byte order etc.
*/
2018-04-23 21:13:27 +02:00
void EnableLanguage(std::vector<std::string> const& languages, cmMakefile*,
bool optional) override;
/**
2012-02-18 12:40:36 +02:00
* Try running cmake and building a file. This is used for dynamically
* loaded commands, not as part of the usual build process.
*/
2019-11-11 23:01:05 +01:00
std::vector<GeneratedMakeCommand> GenerateBuildCommand(
const std::string& makeProgram, const std::string& projectName,
const std::string& projectDir, std::vector<std::string> const& targetNames,
const std::string& config, bool fast, int jobs, bool verbose,
std::vector<std::string> const& makeOptions =
std::vector<std::string>()) override;
/**
* Generate the DSW workspace file.
*/
virtual void OutputSLNFile();
2019-11-11 23:01:05 +01:00
//! Lookup a stored GUID or compute one deterministically.
2015-11-17 17:22:37 +01:00
std::string GetGUID(std::string const& name);
/** Append the subdirectory for the given configuration. */
2018-04-23 21:13:27 +02:00
void AppendDirectoryForConfig(const std::string& prefix,
const std::string& config,
const std::string& suffix,
std::string& dir) override;
2019-11-11 23:01:05 +01:00
//! What is the configurations directory variable called?
2018-04-23 21:13:27 +02:00
const char* GetCMakeCFGIntDir() const override
2016-07-09 11:21:54 +02:00
{
return "$(ConfigurationName)";
}
2009-11-06 22:07:41 +02:00
/** Return true if the target project file should have the option
LinkLibraryDependencies and link to .sln dependencies. */
2016-03-13 13:35:51 +01:00
virtual bool NeedLinkLibraryDependencies(cmGeneratorTarget*)
2016-07-09 11:21:54 +02:00
{
return false;
}
2009-11-06 22:07:41 +02:00
2019-11-11 23:01:05 +01:00
const std::string& GetIntelProjectVersion();
2014-08-03 19:52:23 +02:00
2018-01-26 17:06:56 +01:00
bool FindMakeProgram(cmMakefile* mf) override;
2014-08-03 19:52:23 +02:00
2015-04-27 22:25:09 +02:00
/** Is the Microsoft Assembler enabled? */
bool IsMasmEnabled() const { return this->MasmEnabled; }
2017-07-20 19:35:53 +02:00
bool IsNasmEnabled() const { return this->NasmEnabled; }
2015-04-27 22:25:09 +02:00
// Encoding for Visual Studio files
virtual std::string Encoding();
2015-08-17 11:37:30 +02:00
cmIDEFlagTable const* ExtraFlagTable;
protected:
2019-11-11 23:01:05 +01:00
cmGlobalVisualStudio7Generator(cmake* cm,
std::string const& platformInGeneratorName);
2018-04-23 21:13:27 +02:00
void Generate() override;
2009-10-04 10:30:41 +03:00
2014-08-03 19:52:23 +02:00
std::string const& GetDevEnvCommand();
virtual std::string FindDevEnvCommand();
2020-08-30 11:54:41 +02:00
static const char* ExternalProjectType(const std::string& location);
2014-08-03 19:52:23 +02:00
2012-02-18 12:40:36 +02:00
virtual void OutputSLNFile(cmLocalGenerator* root,
std::vector<cmLocalGenerator*>& generators);
virtual void WriteSLNFile(std::ostream& fout, cmLocalGenerator* root,
2016-07-09 11:21:54 +02:00
std::vector<cmLocalGenerator*>& generators) = 0;
virtual void WriteProject(std::ostream& fout, const std::string& name,
2020-08-30 11:54:41 +02:00
const std::string& path,
const cmGeneratorTarget* t) = 0;
2016-07-09 11:21:54 +02:00
virtual void WriteProjectDepends(std::ostream& fout, const std::string& name,
2020-08-30 11:54:41 +02:00
const std::string& path,
2016-07-09 11:21:54 +02:00
cmGeneratorTarget const* t) = 0;
2013-03-16 19:13:01 +02:00
virtual void WriteProjectConfigurations(
2017-07-20 19:35:53 +02:00
std::ostream& fout, const std::string& name,
cmGeneratorTarget const& target, std::vector<std::string> const& configs,
2013-03-16 19:13:01 +02:00
const std::set<std::string>& configsPartOfDefaultBuild,
2016-07-09 11:21:54 +02:00
const std::string& platformMapping = "") = 0;
2013-03-16 19:13:01 +02:00
virtual void WriteSLNGlobalSections(std::ostream& fout,
cmLocalGenerator* root);
virtual void WriteSLNFooter(std::ostream& fout);
2018-04-23 21:13:27 +02:00
std::string WriteUtilityDepend(const cmGeneratorTarget* target) override;
virtual void WriteTargetsToSolution(
2016-07-09 11:21:54 +02:00
std::ostream& fout, cmLocalGenerator* root,
2009-10-04 10:30:41 +03:00
OrderedTargetDependSet const& projectTargets);
virtual void WriteTargetDepends(
2016-07-09 11:21:54 +02:00
std::ostream& fout, OrderedTargetDependSet const& projectTargets);
virtual void WriteTargetConfigurations(
2016-07-09 11:21:54 +02:00
std::ostream& fout, std::vector<std::string> const& configs,
OrderedTargetDependSet const& projectTargets);
2012-02-18 12:40:36 +02:00
2016-07-09 11:21:54 +02:00
virtual void WriteExternalProject(
2020-08-30 11:54:41 +02:00
std::ostream& fout, const std::string& name, const std::string& path,
const char* typeGuid,
const std::set<BT<std::pair<std::string, bool>>>& dependencies) = 0;
2020-08-30 11:54:41 +02:00
std::string ConvertToSolutionPath(const std::string& path);
2016-07-09 11:21:54 +02:00
std::set<std::string> IsPartOfDefaultBuild(
std::vector<std::string> const& configs,
OrderedTargetDependSet const& projectTargets,
cmGeneratorTarget const* target);
2015-04-27 22:25:09 +02:00
bool IsDependedOn(OrderedTargetDependSet const& projectTargets,
2016-03-13 13:35:51 +01:00
cmGeneratorTarget const* target);
2015-04-27 22:25:09 +02:00
std::map<std::string, std::string> GUIDMap;
2010-11-13 01:00:53 +02:00
virtual void WriteFolders(std::ostream& fout);
virtual void WriteFoldersContent(std::ostream& fout);
2018-01-26 17:06:56 +01:00
std::map<std::string, std::set<std::string>> VisualStudioFolders;
2010-11-13 01:00:53 +02:00
// Set during OutputSLNFile with the name of the current project.
// There is one SLN file per project.
std::string CurrentProject;
2015-04-27 22:25:09 +02:00
bool MasmEnabled;
2017-07-20 19:35:53 +02:00
bool NasmEnabled;
2014-08-03 19:52:23 +02:00
private:
2019-11-11 23:01:05 +01:00
std::string IntelProjectVersion;
2014-08-03 19:52:23 +02:00
std::string DevEnvCommand;
bool DevEnvCommandInitialized;
2018-04-23 21:13:27 +02:00
std::string GetVSMakeProgram() override { return this->GetDevEnvCommand(); }
};
#define CMAKE_CHECK_BUILD_SYSTEM_TARGET "ZERO_CHECK"