Create cmMakefile::PlatformIs64Bit helper method
This method centralizes tests for whether CMAKE_SIZEOF_VOID_P is 8.
This commit is contained in:
parent
f9c0e13975
commit
56d1a1780d
|
@ -324,14 +324,10 @@ void cmFindCommon::AddUserPath(std::string const& p,
|
||||||
// it.
|
// it.
|
||||||
cmSystemTools::KeyWOW64 view = cmSystemTools::KeyWOW64_32;
|
cmSystemTools::KeyWOW64 view = cmSystemTools::KeyWOW64_32;
|
||||||
cmSystemTools::KeyWOW64 other_view = cmSystemTools::KeyWOW64_64;
|
cmSystemTools::KeyWOW64 other_view = cmSystemTools::KeyWOW64_64;
|
||||||
if(const char* psize =
|
if(this->Makefile->PlatformIs64Bit())
|
||||||
this->Makefile->GetDefinition("CMAKE_SIZEOF_VOID_P"))
|
|
||||||
{
|
{
|
||||||
if(atoi(psize) == 8)
|
view = cmSystemTools::KeyWOW64_64;
|
||||||
{
|
other_view = cmSystemTools::KeyWOW64_32;
|
||||||
view = cmSystemTools::KeyWOW64_64;
|
|
||||||
other_view = cmSystemTools::KeyWOW64_32;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Expand using the view of the target application.
|
// Expand using the view of the target application.
|
||||||
|
|
|
@ -329,15 +329,11 @@ bool cmFindPackageCommand
|
||||||
this->DebugMode = this->Makefile->IsOn("CMAKE_FIND_DEBUG_MODE");
|
this->DebugMode = this->Makefile->IsOn("CMAKE_FIND_DEBUG_MODE");
|
||||||
|
|
||||||
// Lookup whether lib64 paths should be used.
|
// Lookup whether lib64 paths should be used.
|
||||||
if(const char* sizeof_dptr =
|
if(this->Makefile->PlatformIs64Bit() &&
|
||||||
this->Makefile->GetDefinition("CMAKE_SIZEOF_VOID_P"))
|
this->Makefile->GetCMakeInstance()
|
||||||
|
->GetPropertyAsBool("FIND_LIBRARY_USE_LIB64_PATHS"))
|
||||||
{
|
{
|
||||||
if(atoi(sizeof_dptr) == 8 &&
|
this->UseLib64Paths = true;
|
||||||
this->Makefile->GetCMakeInstance()
|
|
||||||
->GetPropertyAsBool("FIND_LIBRARY_USE_LIB64_PATHS"))
|
|
||||||
{
|
|
||||||
this->UseLib64Paths = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Find the current root path mode.
|
// Find the current root path mode.
|
||||||
|
|
|
@ -2050,6 +2050,15 @@ bool cmMakefile::IsSet(const char* name) const
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool cmMakefile::PlatformIs64Bit() const
|
||||||
|
{
|
||||||
|
if(const char* sizeof_dptr = this->GetDefinition("CMAKE_SIZEOF_VOID_P"))
|
||||||
|
{
|
||||||
|
return atoi(sizeof_dptr) == 8;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
bool cmMakefile::CanIWriteThisFile(const char* fileName)
|
bool cmMakefile::CanIWriteThisFile(const char* fileName)
|
||||||
{
|
{
|
||||||
if ( !this->IsOn("CMAKE_DISABLE_SOURCE_CHANGES") )
|
if ( !this->IsOn("CMAKE_DISABLE_SOURCE_CHANGES") )
|
||||||
|
|
|
@ -588,6 +588,9 @@ public:
|
||||||
bool IsOn(const char* name) const;
|
bool IsOn(const char* name) const;
|
||||||
bool IsSet(const char* name) const;
|
bool IsSet(const char* name) const;
|
||||||
|
|
||||||
|
/** Return whether the target platform is 64-bit. */
|
||||||
|
bool PlatformIs64Bit() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a list of preprocessor define flags.
|
* Get a list of preprocessor define flags.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue