aboutsummaryrefslogtreecommitdiff
path: root/devtools
diff options
context:
space:
mode:
authorJohannes Schickel2011-04-28 17:44:17 +0200
committerJohannes Schickel2011-04-28 17:45:01 +0200
commit1279264c373ad7f84a1a500ab9514e16847f1812 (patch)
treea04128973f55cbac844ee4f009c70cfcc6d50855 /devtools
parent781e178df3c71441adf96c15c92edad6eab2b59d (diff)
downloadscummvm-rg350-1279264c373ad7f84a1a500ab9514e16847f1812.tar.gz
scummvm-rg350-1279264c373ad7f84a1a500ab9514e16847f1812.tar.bz2
scummvm-rg350-1279264c373ad7f84a1a500ab9514e16847f1812.zip
CREATE_PROJECT: Replace macros by proper functions/methods.
Diffstat (limited to 'devtools')
-rw-r--r--devtools/create_project/msbuild.cpp159
-rw-r--r--devtools/create_project/msbuild.h3
-rw-r--r--devtools/create_project/visualstudio.cpp89
-rw-r--r--devtools/create_project/visualstudio.h4
4 files changed, 133 insertions, 122 deletions
diff --git a/devtools/create_project/msbuild.cpp b/devtools/create_project/msbuild.cpp
index 9d8b9c0407..06425dd4aa 100644
--- a/devtools/create_project/msbuild.cpp
+++ b/devtools/create_project/msbuild.cpp
@@ -52,22 +52,29 @@ int MSBuildProvider::getVisualStudioVersion() {
return 2010;
}
-#define OUTPUT_CONFIGURATION_MSBUILD(config, platform) \
- (project << "\t\t<ProjectConfiguration Include=\"" << config << "|" << platform << "\">\n" \
- "\t\t\t<Configuration>" << config << "</Configuration>\n" \
- "\t\t\t<Platform>" << platform << "</Platform>\n" \
- "\t\t</ProjectConfiguration>\n")
-
-#define OUTPUT_CONFIGURATION_TYPE_MSBUILD(config) \
- (project << "\t<PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='" << config << "'\" Label=\"Configuration\">\n" \
- "\t\t<ConfigurationType>" << (name == PROJECT_NAME ? "Application" : "StaticLibrary") << "</ConfigurationType>\n" \
- "\t</PropertyGroup>\n")
-
-#define OUTPUT_PROPERTIES_MSBUILD(config, properties) \
- (project << "\t<ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='" << config << "'\" Label=\"PropertySheets\">\n" \
- "\t\t<Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n" \
- "\t\t<Import Project=\"" << properties << "\" />\n" \
- "\t</ImportGroup>\n")
+namespace {
+
+inline void outputConfiguration(std::ostream &project, const std::string &config, const std::string &platform) {
+ project << "\t\t<ProjectConfiguration Include=\"" << config << "|" << platform << "\">\n"
+ "\t\t\t<Configuration>" << config << "</Configuration>\n"
+ "\t\t\t<Platform>" << platform << "</Platform>\n"
+ "\t\t</ProjectConfiguration>\n";
+}
+
+inline void outputConfigurationType(std::ostream &project, const std::string &name, const std::string &config) {
+ project << "\t<PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='" << config << "'\" Label=\"Configuration\">\n"
+ "\t\t<ConfigurationType>" << (name == PROJECT_NAME ? "Application" : "StaticLibrary") << "</ConfigurationType>\n"
+ "\t</PropertyGroup>\n";
+}
+
+inline void outputProperties(std::ostream &project, const std::string &config, const std::string &properties) {
+ project << "\t<ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='" << config << "'\" Label=\"PropertySheets\">\n"
+ "\t\t<Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n"
+ "\t\t<Import Project=\"" << properties << "\" />\n"
+ "\t</ImportGroup>\n";
+}
+
+} // End of anonymous namespace
void MSBuildProvider::createProjectFile(const std::string &name, const std::string &uuid, const BuildSetup &setup, const std::string &moduleDir,
const StringList &includeList, const StringList &excludeList) {
@@ -80,12 +87,12 @@ void MSBuildProvider::createProjectFile(const std::string &name, const std::stri
"<Project DefaultTargets=\"Build\" ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n"
"\t<ItemGroup Label=\"ProjectConfigurations\">\n";
- OUTPUT_CONFIGURATION_MSBUILD("Debug", "Win32");
- OUTPUT_CONFIGURATION_MSBUILD("Debug", "x64");
- OUTPUT_CONFIGURATION_MSBUILD("Analysis", "Win32");
- OUTPUT_CONFIGURATION_MSBUILD("Analysis", "x64");
- OUTPUT_CONFIGURATION_MSBUILD("Release", "Win32");
- OUTPUT_CONFIGURATION_MSBUILD("Release", "x64");
+ outputConfiguration(project, "Debug", "Win32");
+ outputConfiguration(project, "Debug", "x64");
+ outputConfiguration(project, "Analysis", "Win32");
+ outputConfiguration(project, "Analysis", "x64");
+ outputConfiguration(project, "Release", "Win32");
+ outputConfiguration(project, "Release", "x64");
project << "\t</ItemGroup>\n";
@@ -99,23 +106,23 @@ void MSBuildProvider::createProjectFile(const std::string &name, const std::stri
// Shared configuration
project << "\t<Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n";
- OUTPUT_CONFIGURATION_TYPE_MSBUILD("Release|Win32");
- OUTPUT_CONFIGURATION_TYPE_MSBUILD("Analysis|Win32");
- OUTPUT_CONFIGURATION_TYPE_MSBUILD("Debug|Win32");
- OUTPUT_CONFIGURATION_TYPE_MSBUILD("Release|x64");
- OUTPUT_CONFIGURATION_TYPE_MSBUILD("Analysis|x64");
- OUTPUT_CONFIGURATION_TYPE_MSBUILD("Debug|x64");
+ outputConfigurationType(project, name, "Release|Win32");
+ outputConfigurationType(project, name, "Analysis|Win32");
+ outputConfigurationType(project, name, "Debug|Win32");
+ outputConfigurationType(project, name, "Release|x64");
+ outputConfigurationType(project, name, "Analysis|x64");
+ outputConfigurationType(project, name, "Debug|x64");
project << "\t<Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\n"
"\t<ImportGroup Label=\"ExtensionSettings\">\n"
"\t</ImportGroup>\n";
- OUTPUT_PROPERTIES_MSBUILD("Release|Win32", PROJECT_DESCRIPTION "_Release.props");
- OUTPUT_PROPERTIES_MSBUILD("Analysis|Win32", PROJECT_DESCRIPTION "_Analysis.props");
- OUTPUT_PROPERTIES_MSBUILD("Debug|Win32", PROJECT_DESCRIPTION "_Debug.props");
- OUTPUT_PROPERTIES_MSBUILD("Release|x64", PROJECT_DESCRIPTION "_Release64.props");
- OUTPUT_PROPERTIES_MSBUILD("Analysis|x64", PROJECT_DESCRIPTION "_Analysis64.props");
- OUTPUT_PROPERTIES_MSBUILD("Debug|x64", PROJECT_DESCRIPTION "_Debug64.props");
+ outputProperties(project, "Release|Win32", PROJECT_DESCRIPTION "_Release.props");
+ outputProperties(project, "Analysis|Win32", PROJECT_DESCRIPTION "_Analysis.props");
+ outputProperties(project, "Debug|Win32", PROJECT_DESCRIPTION "_Debug.props");
+ outputProperties(project, "Release|x64", PROJECT_DESCRIPTION "_Release64.props");
+ outputProperties(project, "Analysis|x64", PROJECT_DESCRIPTION "_Analysis64.props");
+ outputProperties(project, "Debug|x64", PROJECT_DESCRIPTION "_Debug64.props");
project << "\t<PropertyGroup Label=\"UserMacros\" />\n";
@@ -153,21 +160,6 @@ void MSBuildProvider::createProjectFile(const std::string &name, const std::stri
createFiltersFile(setup, name);
}
-#define OUTPUT_FILTER_MSBUILD(files, action) \
- if (!files.empty()) { \
- filters << "\t<ItemGroup>\n"; \
- for (std::list<FileEntry>::const_iterator entry = files.begin(); entry != files.end(); ++entry) { \
- if ((*entry).filter != "") { \
- filters << "\t\t<" action " Include=\"" << (*entry).path << "\">\n" \
- "\t\t\t<Filter>" << (*entry).filter << "</Filter>\n" \
- "\t\t</" action ">\n"; \
- } else { \
- filters << "\t\t<" action " Include=\"" << (*entry).path << "\" />\n"; \
- } \
- } \
- filters << "\t</ItemGroup>\n"; \
- }
-
void MSBuildProvider::createFiltersFile(const BuildSetup &setup, const std::string &name) {
// No filters => no need to create a filter file
if (_filters.empty())
@@ -199,15 +191,31 @@ void MSBuildProvider::createFiltersFile(const BuildSetup &setup, const std::stri
filters << "\t</ItemGroup>\n";
// Output files
- OUTPUT_FILTER_MSBUILD(_compileFiles, "ClCompile")
- OUTPUT_FILTER_MSBUILD(_includeFiles, "ClInclude")
- OUTPUT_FILTER_MSBUILD(_otherFiles, "None")
- OUTPUT_FILTER_MSBUILD(_resourceFiles, "ResourceCompile")
- OUTPUT_FILTER_MSBUILD(_asmFiles, "CustomBuild")
+ outputFilter(filters, _compileFiles, "ClCompile");
+ outputFilter(filters, _includeFiles, "ClInclude");
+ outputFilter(filters, _otherFiles, "None");
+ outputFilter(filters, _resourceFiles, "ResourceCompile");
+ outputFilter(filters, _asmFiles, "CustomBuild");
filters << "</Project>";
}
+void MSBuildProvider::outputFilter(std::ostream &filters, const FileEntries &files, const std::string &action) {
+ if (!files.empty()) {
+ filters << "\t<ItemGroup>\n";
+ for (FileEntries::const_iterator entry = files.begin(), end = files.end(); entry != end; ++entry) {
+ if ((*entry).filter != "") {
+ filters << "\t\t<" << action << " Include=\"" << (*entry).path << "\">\n"
+ "\t\t\t<Filter>" << (*entry).filter << "</Filter>\n"
+ "\t\t</" << action << ">\n";
+ } else {
+ filters << "\t\t<" << action << " Include=\"" << (*entry).path << "\" />\n";
+ }
+ }
+ filters << "\t</ItemGroup>\n";
+ }
+}
+
void MSBuildProvider::writeReferences(std::ofstream &output) {
output << "\t<ItemGroup>\n";
@@ -398,19 +406,6 @@ void MSBuildProvider::createBuildProp(const BuildSetup &setup, bool isRelease, b
properties.close();
}
-#define OUTPUT_NASM_COMMAND_MSBUILD(config) \
- projectFile << "\t\t\t<Command Condition=\"'$(Configuration)|$(Platform)'=='" << config << "|Win32'\">nasm.exe -f win32 -g -o \"$(IntDir)" << (isDuplicate ? (*entry).prefix : "") << "%(Filename).obj\" \"%(FullPath)\"</Command>\n" \
- "\t\t\t<Outputs Condition=\"'$(Configuration)|$(Platform)'=='" << config << "|Win32'\">$(IntDir)" << (isDuplicate ? (*entry).prefix : "") << "%(Filename).obj;%(Outputs)</Outputs>\n";
-
-#define OUPUT_FILES_MSBUILD(files, action) \
- if (!files.empty()) { \
- projectFile << "\t<ItemGroup>\n"; \
- for (std::list<FileEntry>::const_iterator entry = files.begin(); entry != files.end(); ++entry) { \
- projectFile << "\t\t<" action " Include=\"" << (*entry).path << "\" />\n"; \
- } \
- projectFile << "\t</ItemGroup>\n"; \
- }
-
bool hasEnding(std::string const &fullString, std::string const &ending) {
if (fullString.length() > ending.length()) {
return (0 == fullString.compare (fullString.length() - ending.length(), ending.length(), ending));
@@ -419,6 +414,14 @@ bool hasEnding(std::string const &fullString, std::string const &ending) {
}
}
+namespace {
+
+inline void outputNasmCommand(std::ostream &projectFile, const std::string &config, const std::string &prefix) {
+ projectFile << "\t\t\t<Command Condition=\"'$(Configuration)|$(Platform)'=='" << config << "|Win32'\">nasm.exe -f win32 -g -o \"$(IntDir)" << prefix << "%(Filename).obj\" \"%(FullPath)\"</Command>\n"
+ "\t\t\t<Outputs Condition=\"'$(Configuration)|$(Platform)'=='" << config << "|Win32'\">$(IntDir)" << prefix << "%(Filename).obj;%(Outputs)</Outputs>\n";
+}
+
+} // End of anonymous namespace
void MSBuildProvider::writeFileListToProject(const FileNode &dir, std::ofstream &projectFile, const int, const StringList &duplicate,
const std::string &objPrefix, const std::string &filePrefix) {
@@ -455,9 +458,9 @@ void MSBuildProvider::writeFileListToProject(const FileNode &dir, std::ofstream
}
// Output include, other and resource files
- OUPUT_FILES_MSBUILD(_includeFiles, "ClInclude")
- OUPUT_FILES_MSBUILD(_otherFiles, "None")
- OUPUT_FILES_MSBUILD(_resourceFiles, "ResourceCompile")
+ outputFiles(projectFile, _includeFiles, "ClInclude");
+ outputFiles(projectFile, _otherFiles, "None");
+ outputFiles(projectFile, _resourceFiles, "ResourceCompile");
// Output asm files
if (!_asmFiles.empty()) {
@@ -469,9 +472,9 @@ void MSBuildProvider::writeFileListToProject(const FileNode &dir, std::ofstream
projectFile << "\t\t<CustomBuild Include=\"" << (*entry).path << "\">\n"
"\t\t\t<FileType>Document</FileType>\n";
- OUTPUT_NASM_COMMAND_MSBUILD("Debug")
- OUTPUT_NASM_COMMAND_MSBUILD("Analysis")
- OUTPUT_NASM_COMMAND_MSBUILD("Release")
+ outputNasmCommand(projectFile, "Debug", (isDuplicate ? (*entry).prefix : ""));
+ outputNasmCommand(projectFile, "Analysis", (isDuplicate ? (*entry).prefix : ""));
+ outputNasmCommand(projectFile, "Release", (isDuplicate ? (*entry).prefix : ""));
projectFile << "\t\t</CustomBuild>\n";
}
@@ -479,6 +482,16 @@ void MSBuildProvider::writeFileListToProject(const FileNode &dir, std::ofstream
}
}
+void MSBuildProvider::outputFiles(std::ostream &projectFile, const FileEntries &files, const std::string &action) {
+ if (!files.empty()) {
+ projectFile << "\t<ItemGroup>\n";
+ for (FileEntries::const_iterator entry = files.begin(), end = files.end(); entry != end; ++entry) {
+ projectFile << "\t\t<" << action << " Include=\"" << (*entry).path << "\" />\n";
+ }
+ projectFile << "\t</ItemGroup>\n";
+ }
+}
+
void MSBuildProvider::computeFileList(const FileNode &dir, const StringList &duplicate, const std::string &objPrefix, const std::string &filePrefix) {
for (FileNode::NodeList::const_iterator i = dir.children.begin(); i != dir.children.end(); ++i) {
const FileNode *node = *i;
diff --git a/devtools/create_project/msbuild.h b/devtools/create_project/msbuild.h
index cc545e4755..98bb65e19b 100644
--- a/devtools/create_project/msbuild.h
+++ b/devtools/create_project/msbuild.h
@@ -75,6 +75,9 @@ private:
void computeFileList(const FileNode &dir, const StringList &duplicate, const std::string &objPrefix, const std::string &filePrefix);
void createFiltersFile(const BuildSetup &setup, const std::string &name);
+
+ void outputFilter(std::ostream &filters, const FileEntries &files, const std::string &action);
+ void outputFiles(std::ostream &projectFile, const FileEntries &files, const std::string &action);
};
} // End of CreateProjectTool namespace
diff --git a/devtools/create_project/visualstudio.cpp b/devtools/create_project/visualstudio.cpp
index 2997e3096a..77af8aeca1 100644
--- a/devtools/create_project/visualstudio.cpp
+++ b/devtools/create_project/visualstudio.cpp
@@ -57,42 +57,6 @@ int VisualStudioProvider::getVisualStudioVersion() {
error("Unsupported version passed to getVisualStudioVersion");
}
-#define OUTPUT_BUILD_EVENTS(isWin32) \
- if (setup.runBuildEvents) { \
- project << "\t\t\t<Tool\tName=\"VCPreBuildEventTool\"\n" \
- "\t\t\t\tCommandLine=\"" << getPreBuildEvent() << "\"\n" \
- "\t\t\t/>\n" \
- "\t\t\t<Tool\tName=\"VCPostBuildEventTool\"\n" \
- "\t\t\t\tCommandLine=\"" << getPostBuildEvent(isWin32) << "\"\n" \
- "\t\t\t/>\n"; \
- }
-
-#define OUTPUT_CONFIGURATION_MAIN(config, platform, props, isWin32) { \
- project << "\t\t<Configuration Name=\"" << config << "|" << platform << "\" ConfigurationType=\"1\" InheritedPropertySheets=\".\\" << PROJECT_DESCRIPTION << "_" << config << props << ".vsprops\">\n" \
- "\t\t\t<Tool\tName=\"VCCLCompilerTool\" DisableLanguageExtensions=\"false\" />\n" \
- "\t\t\t<Tool\tName=\"VCLinkerTool\" OutputFile=\"$(OutDir)/" << PROJECT_NAME << "\"\n" \
- "\t\t\t\tAdditionalDependencies=\"" << libraries << "\"\n" \
- "\t\t\t/>\n"; \
- OUTPUT_BUILD_EVENTS(isWin32) \
- project << "\t\t</Configuration>\n"; \
-}
-
-#define OUTPUT_CONFIGURATION_DEBUG(config, platform, props, isWin32) { \
- project << "\t\t<Configuration Name=\"" << config << "|" << platform << "\" ConfigurationType=\"1\" InheritedPropertySheets=\".\\" << PROJECT_DESCRIPTION << "_" << config << props << ".vsprops\">\n" \
- "\t\t\t<Tool\tName=\"VCCLCompilerTool\" DisableLanguageExtensions=\"false\" />\n" \
- "\t\t\t<Tool\tName=\"VCLinkerTool\" OutputFile=\"$(OutDir)/" << PROJECT_NAME << ".exe\"\n" \
- "\t\t\t\tAdditionalDependencies=\"" << libraries << "\"\n" \
- "\t\t\t/>\n"; \
- OUTPUT_BUILD_EVENTS(isWin32) \
- project << "\t\t</Configuration>\n"; \
-}
-
-#define OUTPUT_CONFIGURATION(config, platform, props) { \
- project << "\t\t<Configuration Name=\"" << config << "|" << platform << "\" ConfigurationType=\"4\" InheritedPropertySheets=\".\\" << PROJECT_DESCRIPTION << "_" << config << props << ".vsprops\">\n" \
- "\t\t\t<Tool Name=\"VCCLCompilerTool\" "<< toolConfig << "/>\n" \
- "\t\t</Configuration>\n"; \
-}
-
void VisualStudioProvider::createProjectFile(const std::string &name, const std::string &uuid, const BuildSetup &setup, const std::string &moduleDir,
const StringList &includeList, const StringList &excludeList) {
const std::string projectFile = setup.outputDir + '/' + name + getProjectExtension();
@@ -129,17 +93,17 @@ void VisualStudioProvider::createProjectFile(const std::string &name, const std:
libraries += ' ' + *i + ".lib";
// Win32
- OUTPUT_CONFIGURATION_DEBUG("Debug", "Win32", "", true);
- OUTPUT_CONFIGURATION_DEBUG("Analysis", "Win32", "", true);
- OUTPUT_CONFIGURATION_MAIN("Release", "Win32", "", true);
+ outputConfiguration(project, setup, libraries, "Debug", "Win32", "", true);
+ outputConfiguration(project, setup, libraries, "Analysis", "Win32", "", true);
+ outputConfiguration(project, setup, libraries, "Release", "Win32", "", true);
// x64
// For 'x64' we must disable NASM support. Usually we would need to disable the "nasm" feature for that and
// re-create the library list, BUT since NASM doesn't link any additional libraries, we can just use the
// libraries list created for IA-32. If that changes in the future, we need to adjust this part!
- OUTPUT_CONFIGURATION_DEBUG("Debug", "x64", "64", false);
- OUTPUT_CONFIGURATION_DEBUG("Analysis", "x64", "64", false);
- OUTPUT_CONFIGURATION_MAIN("Release", "x64", "64", false);
+ outputConfiguration(project, setup, libraries, "Debug", "x64", "64", false);
+ outputConfiguration(project, setup, libraries, "Analysis", "x64", "64", false);
+ outputConfiguration(project, setup, libraries, "Release", "x64", "64", false);
} else {
std::string warnings = "";
@@ -154,12 +118,12 @@ void VisualStudioProvider::createProjectFile(const std::string &name, const std:
toolConfig += (name == "grim" ? "DisableLanguageExtensions=\"false\" " : "");
// Win32
- OUTPUT_CONFIGURATION("Debug", "Win32", "");
- OUTPUT_CONFIGURATION("Analysis", "Win32", "");
- OUTPUT_CONFIGURATION("Release", "Win32", "");
- OUTPUT_CONFIGURATION("Debug", "x64", "64");
- OUTPUT_CONFIGURATION("Analysis", "x64", "64");
- OUTPUT_CONFIGURATION("Release", "x64", "64");
+ outputConfiguration(project, toolConfig, "Debug", "Win32", "");
+ outputConfiguration(project, toolConfig, "Analysis", "Win32", "");
+ outputConfiguration(project, toolConfig, "Release", "Win32", "");
+ outputConfiguration(project, toolConfig, "Debug", "x64", "64");
+ outputConfiguration(project, toolConfig, "Analysis", "x64", "64");
+ outputConfiguration(project, toolConfig, "Release", "x64", "64");
}
project << "\t</Configurations>\n"
@@ -181,6 +145,33 @@ void VisualStudioProvider::createProjectFile(const std::string &name, const std:
"</VisualStudioProject>\n";
}
+void VisualStudioProvider::outputConfiguration(std::ostream &project, const BuildSetup &setup, const std::string &libraries, const std::string &config, const std::string &platform, const std::string &props, const bool isWin32) {
+ project << "\t\t<Configuration Name=\"" << config << "|" << platform << "\" ConfigurationType=\"1\" InheritedPropertySheets=\".\\" << PROJECT_DESCRIPTION << "_" << config << props << ".vsprops\">\n"
+ "\t\t\t<Tool\tName=\"VCCLCompilerTool\" DisableLanguageExtensions=\"false\" />\n"
+ "\t\t\t<Tool\tName=\"VCLinkerTool\" OutputFile=\"$(OutDir)/" << PROJECT_NAME << "\"\n"
+ "\t\t\t\tAdditionalDependencies=\"" << libraries << "\"\n"
+ "\t\t\t/>\n";
+ outputBuildEvents(project, setup, isWin32);
+ project << "\t\t</Configuration>\n";
+}
+
+void VisualStudioProvider::outputConfiguration(std::ostream &project, const std::string &toolConfig, const std::string &config, const std::string &platform, const std::string &props) {
+ project << "\t\t<Configuration Name=\"" << config << "|" << platform << "\" ConfigurationType=\"4\" InheritedPropertySheets=\".\\" << PROJECT_DESCRIPTION << "_" << config << props << ".vsprops\">\n"
+ "\t\t\t<Tool Name=\"VCCLCompilerTool\" "<< toolConfig << "/>\n"
+ "\t\t</Configuration>\n";
+}
+
+void VisualStudioProvider::outputBuildEvents(std::ostream &project, const BuildSetup &setup, const bool isWin32) {
+ if (setup.runBuildEvents) {
+ project << "\t\t\t<Tool\tName=\"VCPreBuildEventTool\"\n"
+ "\t\t\t\tCommandLine=\"" << getPreBuildEvent() << "\"\n"
+ "\t\t\t/>\n"
+ "\t\t\t<Tool\tName=\"VCPostBuildEventTool\"\n"
+ "\t\t\t\tCommandLine=\"" << getPostBuildEvent(isWin32) << "\"\n"
+ "\t\t\t/>\n";
+ }
+}
+
void VisualStudioProvider::writeReferences(std::ofstream &output) {
output << "\tProjectSection(ProjectDependencies) = postProject\n";
@@ -298,7 +289,7 @@ void VisualStudioProvider::createBuildProp(const BuildSetup &setup, bool isRelea
"\t\tRuntimeLibrary=\"1\"\n"
"\t\tEnableFunctionLevelLinking=\"true\"\n"
"\t\tWarnAsError=\"false\"\n"
- "\t\tDebugInformationFormat=\"" << (isWin32 ? "4" : "3") << "\"\n" // For x64 format "4" (Edit and continue) is not supported, thus we default to "3"
+ "\t\tDebugInformationFormat=\"" << (isWin32 ? "4" : "3") << "\"\n" // For x64 format "4" (Edit and continue) is not supported, thus we default to "3"
"\t\tAdditionalOption=\"" << (enableAnalysis ? "/analyze" : "") << "\"\n"
"\t/>\n"
"\t<Tool\n"
diff --git a/devtools/create_project/visualstudio.h b/devtools/create_project/visualstudio.h
index a1d5c76b01..0e4b441e63 100644
--- a/devtools/create_project/visualstudio.h
+++ b/devtools/create_project/visualstudio.h
@@ -50,6 +50,10 @@ protected:
const char *getProjectExtension();
const char *getPropertiesExtension();
int getVisualStudioVersion();
+
+ void outputConfiguration(std::ostream &project, const BuildSetup &setup, const std::string &libraries, const std::string &config, const std::string &platform, const std::string &props, const bool isWin32);
+ void outputConfiguration(std::ostream &project, const std::string &toolConfig, const std::string &config, const std::string &platform, const std::string &props);
+ void outputBuildEvents(std::ostream &project, const BuildSetup &setup, const bool isWin32);
};
} // End of CreateProjectTool namespace