Add GetLocal on cmMakefile and on local builds do not perform tests
This commit is contained in:
parent
571c483ad8
commit
202600f95a
|
@ -1421,3 +1421,8 @@ cmCacheManager *cmMakefile::GetCacheManager() const
|
||||||
{
|
{
|
||||||
return m_LocalGenerator->GetGlobalGenerator()->GetCMakeInstance()->GetCacheManager();
|
return m_LocalGenerator->GetGlobalGenerator()->GetCMakeInstance()->GetCacheManager();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool cmMakefile::GetLocal() const
|
||||||
|
{
|
||||||
|
return m_LocalGenerator->GetGlobalGenerator()->GetCMakeInstance()->GetLocal();
|
||||||
|
}
|
||||||
|
|
|
@ -515,6 +515,9 @@ public:
|
||||||
*/
|
*/
|
||||||
cmCacheManager *GetCacheManager() const;
|
cmCacheManager *GetCacheManager() const;
|
||||||
|
|
||||||
|
//! Determine wether this is a local or global build.
|
||||||
|
bool GetLocal() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// add link libraries and directories to the target
|
// add link libraries and directories to the target
|
||||||
void AddGlobalLinkInformation(const char* name, cmTarget& target);
|
void AddGlobalLinkInformation(const char* name, cmTarget& target);
|
||||||
|
|
|
@ -94,7 +94,7 @@ int cmTryCompileCommand::CoreTryCompileCode(
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// compute the binary dir when TRY_COMPILE is called with a src file
|
// compute the binary dir when TRY_COMPILE is called with a src file
|
||||||
// signature
|
// signature
|
||||||
if (srcFileSignature)
|
if (srcFileSignature)
|
||||||
|
@ -170,7 +170,9 @@ int cmTryCompileCommand::CoreTryCompileCode(
|
||||||
projectName, targetName, &cmakeFlags, &output);
|
projectName, targetName, &cmakeFlags, &output);
|
||||||
|
|
||||||
// set the result var to the return value to indicate success or failure
|
// set the result var to the return value to indicate success or failure
|
||||||
mf->AddDefinition(argv[0].c_str(), (res == 0 ? "TRUE" : "FALSE"));
|
mf->AddCacheDefinition(argv[0].c_str(), (res == 0 ? "TRUE" : "FALSE"),
|
||||||
|
"Result of TRY_COMPILE",
|
||||||
|
cmCacheManager::INTERNAL);
|
||||||
|
|
||||||
if ( outputVariable.size() > 0 )
|
if ( outputVariable.size() > 0 )
|
||||||
{
|
{
|
||||||
|
@ -208,6 +210,11 @@ bool cmTryCompileCommand::InitialPass(std::vector<std::string> const& argv)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( m_Makefile->GetLocal() )
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
cmTryCompileCommand::CoreTryCompileCode(m_Makefile,argv,true);
|
cmTryCompileCommand::CoreTryCompileCode(m_Makefile,argv,true);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -26,6 +26,11 @@ bool cmTryRunCommand::InitialPass(std::vector<std::string> const& argv)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( m_Makefile->GetLocal() )
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
// build an arg list for TryCompile and extract the runArgs
|
// build an arg list for TryCompile and extract the runArgs
|
||||||
std::vector<std::string> tryCompile;
|
std::vector<std::string> tryCompile;
|
||||||
std::string runArgs;
|
std::string runArgs;
|
||||||
|
@ -98,7 +103,8 @@ bool cmTryRunCommand::InitialPass(std::vector<std::string> const& argv)
|
||||||
// set the run var
|
// set the run var
|
||||||
char retChar[1000];
|
char retChar[1000];
|
||||||
sprintf(retChar,"%i",retVal);
|
sprintf(retChar,"%i",retVal);
|
||||||
m_Makefile->AddDefinition(argv[0].c_str(), retChar);
|
m_Makefile->AddCacheDefinition(argv[0].c_str(), retChar,
|
||||||
|
"Result of TRY_RUN", cmCacheManager::INTERNAL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue