Teach VS generators to set the MACHINE type correctly.

This commit is contained in:
Bill Hoffman 2009-11-20 11:55:28 -05:00
parent bbbdf54a35
commit 268448b891
12 changed files with 30 additions and 16 deletions

View File

@ -25,6 +25,8 @@ cmGlobalVisualStudio10Generator::cmGlobalVisualStudio10Generator()
void cmGlobalVisualStudio10Generator::AddPlatformDefinitions(cmMakefile* mf)
{
mf->AddDefinition("MSVC10", "1");
mf->AddDefinition("MSVC_C_ARCHITECTURE_ID", "X86");
mf->AddDefinition("MSVC_CXX_ARCHITECTURE_ID", "X86");
}
//----------------------------------------------------------------------------

View File

@ -29,9 +29,11 @@ void cmGlobalVisualStudio10Win64Generator
}
//----------------------------------------------------------------------------
void cmGlobalVisualStudio10Win64Generator::EnableLanguage(
std::vector<std::string> const& lang, cmMakefile *mf, bool optional)
void cmGlobalVisualStudio10Win64Generator
::AddPlatformDefinitions(cmMakefile* mf)
{
this->cmGlobalVisualStudio10Generator::AddPlatformDefinitions(mf);
mf->AddDefinition("CMAKE_FORCE_WIN64", "TRUE");
cmGlobalVisualStudio10Generator::EnableLanguage(lang, mf, optional);
mf->AddDefinition("MSVC_C_ARCHITECTURE_ID", "X86");
mf->AddDefinition("MSVC_CXX_ARCHITECTURE_ID", "X86");
}

View File

@ -30,7 +30,7 @@ public:
/** Get the documentation entry for this generator. */
virtual void GetDocumentation(cmDocumentationEntry& entry) const;
virtual void EnableLanguage(std::vector<std::string>const& languages,
cmMakefile *, bool optional);
virtual void AddPlatformDefinitions(cmMakefile* mf);
};
#endif

View File

@ -44,6 +44,8 @@ void cmGlobalVisualStudio6Generator
mf->AddDefinition("CMAKE_GENERATOR_RC", "rc");
mf->AddDefinition("CMAKE_GENERATOR_NO_COMPILER_ENV", "1");
mf->AddDefinition("CMAKE_GENERATOR_Fortran", "ifort");
mf->AddDefinition("MSVC_C_ARCHITECTURE_ID", "X86");
mf->AddDefinition("MSVC_CXX_ARCHITECTURE_ID", "X86");
mf->AddDefinition("MSVC60", "1");
this->GenerateConfigurations(mf);
this->cmGlobalGenerator::EnableLanguage(lang, mf, optional);

View File

@ -36,6 +36,7 @@ cmLocalGenerator *cmGlobalVisualStudio71Generator::CreateLocalGenerator()
//----------------------------------------------------------------------------
void cmGlobalVisualStudio71Generator::AddPlatformDefinitions(cmMakefile* mf)
{
this->cmGlobalVisualStudio7Generator::AddPlatformDefinitions(mf);
mf->AddDefinition("MSVC71", "1");
}

View File

@ -31,7 +31,6 @@ void cmGlobalVisualStudio7Generator
mf->AddDefinition("CMAKE_GENERATOR_RC", "rc");
mf->AddDefinition("CMAKE_GENERATOR_NO_COMPILER_ENV", "1");
mf->AddDefinition("CMAKE_GENERATOR_FC", "ifort");
this->AddPlatformDefinitions(mf);
// Create list of configurations requested by user's cache, if any.
@ -59,6 +58,8 @@ void cmGlobalVisualStudio7Generator
void cmGlobalVisualStudio7Generator::AddPlatformDefinitions(cmMakefile* mf)
{
mf->AddDefinition("MSVC70", "1");
mf->AddDefinition("MSVC_C_ARCHITECTURE_ID", "X86");
mf->AddDefinition("MSVC_CXX_ARCHITECTURE_ID", "X86");
}
std::string cmGlobalVisualStudio7Generator

View File

@ -55,6 +55,8 @@ void cmGlobalVisualStudio8Generator
//----------------------------------------------------------------------------
void cmGlobalVisualStudio8Generator::AddPlatformDefinitions(cmMakefile* mf)
{
mf->AddDefinition("MSVC_C_ARCHITECTURE_ID", "X86");
mf->AddDefinition("MSVC_CXX_ARCHITECTURE_ID", "X86");
mf->AddDefinition("MSVC80", "1");
}

View File

@ -42,10 +42,12 @@ void cmGlobalVisualStudio8Win64Generator
entry.Full = "";
}
//----------------------------------------------------------------------------
void cmGlobalVisualStudio8Win64Generator
::EnableLanguage(std::vector<std::string>const & lang,
cmMakefile *mf, bool optional)
::AddPlatformDefinitions(cmMakefile* mf)
{
this->cmGlobalVisualStudio8Generator::AddPlatformDefinitions(mf);
mf->AddDefinition("CMAKE_FORCE_WIN64", "TRUE");
cmGlobalVisualStudio8Generator::EnableLanguage(lang, mf, optional);
mf->AddDefinition("MSVC_C_ARCHITECTURE_ID", "x64");
mf->AddDefinition("MSVC_CXX_ARCHITECTURE_ID", "x64");
}

View File

@ -43,7 +43,6 @@ public:
* Try to determine system infomation such as shared library
* extension, pthreads, byte order etc.
*/
virtual void EnableLanguage(std::vector<std::string>const& languages,
cmMakefile *, bool optional);
virtual void AddPlatformDefinitions(cmMakefile *);
};
#endif

View File

@ -25,6 +25,8 @@ cmGlobalVisualStudio9Generator::cmGlobalVisualStudio9Generator()
//----------------------------------------------------------------------------
void cmGlobalVisualStudio9Generator::AddPlatformDefinitions(cmMakefile* mf)
{
mf->AddDefinition("MSVC_C_ARCHITECTURE_ID", "X86");
mf->AddDefinition("MSVC_CXX_ARCHITECTURE_ID", "X86");
mf->AddDefinition("MSVC90", "1");
}

View File

@ -39,10 +39,12 @@ void cmGlobalVisualStudio9Win64Generator
entry.Full = "";
}
//----------------------------------------------------------------------------
void cmGlobalVisualStudio9Win64Generator
::EnableLanguage(std::vector<std::string>const & lang,
cmMakefile *mf, bool optional)
::AddPlatformDefinitions(cmMakefile* mf)
{
cmGlobalVisualStudio9Generator::AddPlatformDefinitions(mf);
mf->AddDefinition("CMAKE_FORCE_WIN64", "TRUE");
cmGlobalVisualStudio9Generator::EnableLanguage(lang, mf, optional);
mf->AddDefinition("MSVC_C_ARCHITECTURE_ID", "x64");
mf->AddDefinition("MSVC_CXX_ARCHITECTURE_ID", "x64");
}

View File

@ -43,7 +43,6 @@ public:
* Try to determine system infomation such as shared library
* extension, pthreads, byte order etc.
*/
virtual void EnableLanguage(std::vector<std::string>const& languages,
cmMakefile *, bool optional);
virtual void AddPlatformDefinitions(cmMakefile *);
};
#endif