CREATE_PROJECT: Fix VS2008 property names

This commit is contained in:
SupSuper 2020-07-14 05:55:35 +01:00 committed by Eugene Sandulenko
parent 680da50b81
commit 95d191e19a
3 changed files with 13 additions and 15 deletions

View file

@ -102,7 +102,7 @@ void MSBuildProvider::createProjectFile(const std::string &name, const std::stri
"\t\t<VCTargetsPath Condition=\"'$(VCTargetsPath" << _version << ")' != '' and '$(VSVersion)' == '' and $(VisualStudioVersion) == ''\">$(VCTargetsPath" << _version << ")</VCTargetsPath>\n"; "\t\t<VCTargetsPath Condition=\"'$(VCTargetsPath" << _version << ")' != '' and '$(VSVersion)' == '' and $(VisualStudioVersion) == ''\">$(VCTargetsPath" << _version << ")</VCTargetsPath>\n";
for (std::list<MSVC_Architecture>::const_iterator arch = _archs.begin(); arch != _archs.end(); ++arch) { for (std::list<MSVC_Architecture>::const_iterator arch = _archs.begin(); arch != _archs.end(); ++arch) {
project << "\t\t<VcpkgTriplet Condition=\"'$(Platform)' == '" << getMSVCConfigName(*arch) << "'\">" << getMSVCArchName(*arch) << "-windows</VcpkgTriplet>"; project << "\t\t<VcpkgTriplet Condition=\"'$(Platform)' == '" << getMSVCConfigName(*arch) << "'\">" << getMSVCArchName(*arch) << "-windows</VcpkgTriplet>\n";
} }
project << "\t</PropertyGroup>\n"; project << "\t</PropertyGroup>\n";
@ -399,8 +399,6 @@ void MSBuildProvider::outputGlobalPropFile(const BuildSetup &setup, std::ofstrea
} }
void MSBuildProvider::createBuildProp(const BuildSetup &setup, bool isRelease, MSVC_Architecture arch, const std::string &configuration) { void MSBuildProvider::createBuildProp(const BuildSetup &setup, bool isRelease, MSVC_Architecture arch, const std::string &configuration) {
const std::string outputBitness = (arch == ARCH_X86 ? "32" : "64");
std::ofstream properties((setup.outputDir + '/' + setup.projectDescription + "_" + configuration + getMSVCArchName(arch) + getPropertiesExtension()).c_str()); std::ofstream properties((setup.outputDir + '/' + setup.projectDescription + "_" + configuration + getMSVCArchName(arch) + getPropertiesExtension()).c_str());
if (!properties || !properties.is_open()) { if (!properties || !properties.is_open()) {
error("Could not open \"" + setup.outputDir + '/' + setup.projectDescription + "_" + configuration + getMSVCArchName(arch) + getPropertiesExtension() + "\" for writing"); error("Could not open \"" + setup.outputDir + '/' + setup.projectDescription + "_" + configuration + getMSVCArchName(arch) + getPropertiesExtension() + "\" for writing");
@ -455,6 +453,7 @@ void MSBuildProvider::createBuildProp(const BuildSetup &setup, bool isRelease, M
if (configuration == "LLVM") { if (configuration == "LLVM") {
// FIXME The LLVM cl wrapper does not seem to work properly with the $(TargetDir) path so we hard-code the build folder until the issue is resolved // FIXME The LLVM cl wrapper does not seem to work properly with the $(TargetDir) path so we hard-code the build folder until the issue is resolved
const std::string outputBitness = (arch == ARCH_X86 ? "32" : "64");
properties << "\t\t\t<AdditionalIncludeDirectories>" << configuration << outputBitness <<";%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n" properties << "\t\t\t<AdditionalIncludeDirectories>" << configuration << outputBitness <<";%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n"
"\t\t\t<AdditionalOptions>-Wno-microsoft -Wno-long-long -Wno-multichar -Wno-unknown-pragmas -Wno-reorder -Wpointer-arith -Wcast-qual -Wshadow -Wnon-virtual-dtor -Wwrite-strings -Wno-conversion -Wno-shorten-64-to-32 -Wno-sign-compare -Wno-four-char-constants -Wno-nested-anon-types -Qunused-arguments %(AdditionalOptions)</AdditionalOptions>\n"; "\t\t\t<AdditionalOptions>-Wno-microsoft -Wno-long-long -Wno-multichar -Wno-unknown-pragmas -Wno-reorder -Wpointer-arith -Wcast-qual -Wshadow -Wnon-virtual-dtor -Wwrite-strings -Wno-conversion -Wno-shorten-64-to-32 -Wno-sign-compare -Wno-four-char-constants -Wno-nested-anon-types -Qunused-arguments %(AdditionalOptions)</AdditionalOptions>\n";
} }

View file

@ -109,11 +109,10 @@ void VisualStudioProvider::createProjectFile(const std::string &name, const std:
toolConfig += (enableLanguageExtensions ? "DisableLanguageExtensions=\"false\" " : ""); toolConfig += (enableLanguageExtensions ? "DisableLanguageExtensions=\"false\" " : "");
for (std::list<MSVC_Architecture>::const_iterator arch = _archs.begin(); arch != _archs.end(); ++arch) { for (std::list<MSVC_Architecture>::const_iterator arch = _archs.begin(); arch != _archs.end(); ++arch) {
const std::string outputBitness = (*arch == ARCH_X86 ? "" : "64"); outputConfiguration(setup, project, toolConfig, "Debug", *arch);
outputConfiguration(setup, project, toolConfig, "Debug", getMSVCConfigName(*arch), outputBitness); outputConfiguration(setup, project, toolConfig, "Analysis", *arch);
outputConfiguration(setup, project, toolConfig, "Analysis", getMSVCConfigName(*arch), outputBitness); outputConfiguration(setup, project, toolConfig, "LLVM", *arch);
outputConfiguration(setup, project, toolConfig, "LLVM", getMSVCConfigName(*arch), outputBitness); outputConfiguration(setup, project, toolConfig, "Release", *arch);
outputConfiguration(setup, project, toolConfig, "Release", getMSVCConfigName(*arch), outputBitness);
} }
} }
@ -151,8 +150,8 @@ void VisualStudioProvider::outputConfiguration(std::ostream &project, const Buil
project << "\t\t</Configuration>\n"; project << "\t\t</Configuration>\n";
} }
void VisualStudioProvider::outputConfiguration(const BuildSetup &setup, std::ostream &project, const std::string &toolConfig, const std::string &config, const std::string &platform, const std::string &props) { void VisualStudioProvider::outputConfiguration(const BuildSetup &setup, std::ostream &project, const std::string &toolConfig, const std::string &config, const MSVC_Architecture arch) {
project << "\t\t<Configuration Name=\"" << config << "|" << platform << "\" ConfigurationType=\"4\" InheritedPropertySheets=\".\\" << setup.projectDescription << "_" << config << props << ".vsprops\">\n" project << "\t\t<Configuration Name=\"" << config << "|" << getMSVCConfigName(arch) << "\" ConfigurationType=\"4\" InheritedPropertySheets=\".\\" << setup.projectDescription << "_" << config << getMSVCArchName(arch) << ".vsprops\">\n"
"\t\t\t<Tool Name=\"VCCLCompilerTool\" "<< toolConfig << "/>\n" "\t\t\t<Tool Name=\"VCCLCompilerTool\" "<< toolConfig << "/>\n"
"\t\t</Configuration>\n"; "\t\t</Configuration>\n";
} }
@ -260,9 +259,9 @@ void VisualStudioProvider::outputGlobalPropFile(const BuildSetup &setup, std::of
void VisualStudioProvider::createBuildProp(const BuildSetup &setup, bool isRelease, MSVC_Architecture arch, const std::string &configuration) { void VisualStudioProvider::createBuildProp(const BuildSetup &setup, bool isRelease, MSVC_Architecture arch, const std::string &configuration) {
std::ofstream properties((setup.outputDir + '/' + setup.projectDescription + "_" + configuration + getMSVCConfigName(arch) + getPropertiesExtension()).c_str()); std::ofstream properties((setup.outputDir + '/' + setup.projectDescription + "_" + configuration + getMSVCArchName(arch) + getPropertiesExtension()).c_str());
if (!properties || !properties.is_open()) { if (!properties || !properties.is_open()) {
error("Could not open \"" + setup.outputDir + '/' + setup.projectDescription + "_" + configuration + getMSVCConfigName(arch) + getPropertiesExtension() + "\" for writing"); error("Could not open \"" + setup.outputDir + '/' + setup.projectDescription + "_" + configuration + getMSVCArchName(arch) + getPropertiesExtension() + "\" for writing");
return; return;
} }
@ -270,8 +269,8 @@ void VisualStudioProvider::createBuildProp(const BuildSetup &setup, bool isRelea
"<VisualStudioPropertySheet\n" "<VisualStudioPropertySheet\n"
"\tProjectType=\"Visual C++\"\n" "\tProjectType=\"Visual C++\"\n"
"\tVersion=\"8.00\"\n" "\tVersion=\"8.00\"\n"
"\tName=\"" << setup.projectDescription << "_" << configuration << getMSVCConfigName(arch) << "\"\n" "\tName=\"" << setup.projectDescription << "_" << configuration << getMSVCArchName(arch) << "\"\n"
"\tInheritedPropertySheets=\".\\" << setup.projectDescription << "_Global" << getMSVCConfigName(arch) << ".vsprops\"\n" "\tInheritedPropertySheets=\".\\" << setup.projectDescription << "_Global" << getMSVCArchName(arch) << ".vsprops\"\n"
"\t>\n" "\t>\n"
"\t<Tool\n" "\t<Tool\n"
"\t\tName=\"VCCLCompilerTool\"\n"; "\t\tName=\"VCCLCompilerTool\"\n";

View file

@ -51,7 +51,7 @@ protected:
const char *getPropertiesExtension(); const char *getPropertiesExtension();
void outputConfiguration(std::ostream &project, const BuildSetup &setup, const std::string &libraries, const std::string &config, const MSVC_Architecture arch); void outputConfiguration(std::ostream &project, const BuildSetup &setup, const std::string &libraries, const std::string &config, const MSVC_Architecture arch);
void outputConfiguration(const BuildSetup &setup, std::ostream &project, const std::string &toolConfig, const std::string &config, const std::string &platform, const std::string &props); void outputConfiguration(const BuildSetup &setup, std::ostream &project, const std::string &toolConfig, const std::string &config, const MSVC_Architecture arch);
void outputBuildEvents(std::ostream &project, const BuildSetup &setup, const MSVC_Architecture arch); void outputBuildEvents(std::ostream &project, const BuildSetup &setup, const MSVC_Architecture arch);
}; };