CREATE_PROJECT: Fix defines for x64 MSVC project

Rewriting the define list from scratch to disable nasm lost
a lot of important defines set up in the setup phase.
Instead, let's just remove the nasm define and preserve the rest.
This commit is contained in:
SupSuper 2019-07-01 02:46:02 +01:00 committed by Filippos Karapetis
parent 05511e17ec
commit 12198cee35

View file

@ -25,6 +25,7 @@
#include <fstream>
#include <algorithm>
#include <cstring>
namespace CreateProjectTool {
@ -147,17 +148,14 @@ void MSVCProvider::createGlobalProp(const BuildSetup &setup) {
if (!properties)
error("Could not open \"" + setup.outputDir + '/' + setup.projectDescription + "_Global64" + getPropertiesExtension() + "\" for writing");
// HACK: We must disable the "nasm" feature for x64. To achieve that we must duplicate the feature list and
// recreate a define list.
FeatureList x64Features = setup.features;
setFeatureBuildState("nasm", x64Features, false);
StringList x64Defines = getFeatureDefines(x64Features);
StringList x64EngineDefines = getEngineDefines(setup.engines);
x64Defines.splice(x64Defines.end(), x64EngineDefines);
// HACK: This definitely should not be here, but otherwise we would not define SDL_BACKEND for x64.
x64Defines.push_back("WIN32");
x64Defines.push_back("SDL_BACKEND");
// HACK: We must disable the "nasm" feature for x64. To achieve that we must recreate the define list.
StringList x64Defines = setup.defines;
for (FeatureList::const_iterator i = setup.features.begin(); i != setup.features.end(); ++i) {
if (i->enable && i->define && i->define[0] && !strcmp(i->name, "nasm")) {
x64Defines.remove(i->define);
break;
}
}
outputGlobalPropFile(setup, properties, 64, x64Defines, convertPathToWin(setup.filePrefix), setup.runBuildEvents);
}