BUG: CMAKE_TRY_COMPILE_CONFIGURATION should be obtained from the cmMakefile instance for the listfile containing the TRY_COMPILE call, not the top level listfile.
This commit is contained in:
parent
f99d948916
commit
9b1771aef4
|
@ -44,7 +44,8 @@ int cmGlobalCodeWarriorGenerator::TryCompile(const char *,
|
||||||
const char* /*bindir*/,
|
const char* /*bindir*/,
|
||||||
const char* /*projectName*/,
|
const char* /*projectName*/,
|
||||||
const char* /*targetName*/,
|
const char* /*targetName*/,
|
||||||
std::string* /*output*/)
|
std::string* /*output*/,
|
||||||
|
cmMakefile* /*mf*/)
|
||||||
{
|
{
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,7 +54,7 @@ public:
|
||||||
*/
|
*/
|
||||||
virtual int TryCompile(const char *srcdir, const char *bindir,
|
virtual int TryCompile(const char *srcdir, const char *bindir,
|
||||||
const char *projectName, const char *targetName,
|
const char *projectName, const char *targetName,
|
||||||
std::string *output);
|
std::string *output, cmMakefile* mf);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generate the all required files for building this project/tree. This
|
* Generate the all required files for building this project/tree. This
|
||||||
|
|
|
@ -448,7 +448,7 @@ void cmGlobalGenerator::LocalGenerate()
|
||||||
|
|
||||||
int cmGlobalGenerator::TryCompile(const char *, const char *bindir,
|
int cmGlobalGenerator::TryCompile(const char *, const char *bindir,
|
||||||
const char *, const char *target,
|
const char *, const char *target,
|
||||||
std::string *output)
|
std::string *output, cmMakefile*)
|
||||||
{
|
{
|
||||||
// now build the test
|
// now build the test
|
||||||
std::string makeCommand =
|
std::string makeCommand =
|
||||||
|
|
|
@ -90,7 +90,7 @@ public:
|
||||||
*/
|
*/
|
||||||
virtual int TryCompile(const char *srcdir, const char *bindir,
|
virtual int TryCompile(const char *srcdir, const char *bindir,
|
||||||
const char *projectName, const char *targetName,
|
const char *projectName, const char *targetName,
|
||||||
std::string *output);
|
std::string *output, cmMakefile* mf);
|
||||||
|
|
||||||
///! Set the CMake instance
|
///! Set the CMake instance
|
||||||
void SetCMakeInstance(cmake *cm) {
|
void SetCMakeInstance(cmake *cm) {
|
||||||
|
|
|
@ -68,7 +68,8 @@ int cmGlobalVisualStudio6Generator::TryCompile(const char *,
|
||||||
const char *bindir,
|
const char *bindir,
|
||||||
const char *projectName,
|
const char *projectName,
|
||||||
const char *targetName,
|
const char *targetName,
|
||||||
std::string *output)
|
std::string *output,
|
||||||
|
cmMakefile* mf)
|
||||||
{
|
{
|
||||||
// now build the test
|
// now build the test
|
||||||
std::string makeCommand =
|
std::string makeCommand =
|
||||||
|
@ -115,10 +116,9 @@ int cmGlobalVisualStudio6Generator::TryCompile(const char *,
|
||||||
makeCommand += "ALL_BUILD";
|
makeCommand += "ALL_BUILD";
|
||||||
}
|
}
|
||||||
makeCommand += " - ";
|
makeCommand += " - ";
|
||||||
if ( m_LocalGenerators[0]->GetMakefile()->GetDefinition("CMAKE_TRY_COMPILE_CONFIGURATION") )
|
if(const char* config = mf->GetDefinition("CMAKE_TRY_COMPILE_CONFIGURATION"))
|
||||||
{
|
{
|
||||||
makeCommand +=
|
makeCommand += config;
|
||||||
m_LocalGenerators[0]->GetMakefile()->GetDefinition("CMAKE_TRY_COMPILE_CONFIGURATION");
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -55,7 +55,7 @@ public:
|
||||||
*/
|
*/
|
||||||
virtual int TryCompile(const char *srcdir, const char *bindir,
|
virtual int TryCompile(const char *srcdir, const char *bindir,
|
||||||
const char *projectName, const char *targetName,
|
const char *projectName, const char *targetName,
|
||||||
std::string *output);
|
std::string *output, cmMakefile* mf);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generate the all required files for building this project/tree. This
|
* Generate the all required files for building this project/tree. This
|
||||||
|
|
|
@ -44,7 +44,8 @@ int cmGlobalVisualStudio7Generator::TryCompile(const char *,
|
||||||
const char *bindir,
|
const char *bindir,
|
||||||
const char *projectName,
|
const char *projectName,
|
||||||
const char *targetName,
|
const char *targetName,
|
||||||
std::string *output)
|
std::string *output,
|
||||||
|
cmMakefile* mf)
|
||||||
{
|
{
|
||||||
// now build the test
|
// now build the test
|
||||||
std::string makeCommand =
|
std::string makeCommand =
|
||||||
|
@ -77,10 +78,9 @@ int cmGlobalVisualStudio7Generator::TryCompile(const char *,
|
||||||
makeCommand += " ";
|
makeCommand += " ";
|
||||||
makeCommand += projectName;
|
makeCommand += projectName;
|
||||||
makeCommand += ".sln /build ";
|
makeCommand += ".sln /build ";
|
||||||
if ( m_LocalGenerators[0]->GetMakefile()->GetDefinition("CMAKE_TRY_COMPILE_CONFIGURATION") )
|
if(const char* config = mf->GetDefinition("CMAKE_TRY_COMPILE_CONFIGURATION"))
|
||||||
{
|
{
|
||||||
makeCommand +=
|
makeCommand += config;
|
||||||
m_LocalGenerators[0]->GetMakefile()->GetDefinition("CMAKE_TRY_COMPILE_CONFIGURATION");
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -55,7 +55,7 @@ public:
|
||||||
*/
|
*/
|
||||||
virtual int TryCompile(const char *srcdir, const char *bindir,
|
virtual int TryCompile(const char *srcdir, const char *bindir,
|
||||||
const char *projectName, const char *targetName,
|
const char *projectName, const char *targetName,
|
||||||
std::string *output);
|
std::string *output, cmMakefile* mf);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generate the all required files for building this project/tree. This
|
* Generate the all required files for building this project/tree. This
|
||||||
|
|
|
@ -2093,7 +2093,8 @@ int cmMakefile::TryCompile(const char *srcdir, const char *bindir,
|
||||||
m_LocalGenerator->GetGlobalGenerator()->TryCompile(srcdir,bindir,
|
m_LocalGenerator->GetGlobalGenerator()->TryCompile(srcdir,bindir,
|
||||||
projectName,
|
projectName,
|
||||||
targetName,
|
targetName,
|
||||||
output);
|
output,
|
||||||
|
this);
|
||||||
|
|
||||||
cmSystemTools::ChangeDirectory(cwd.c_str());
|
cmSystemTools::ChangeDirectory(cwd.c_str());
|
||||||
return ret;
|
return ret;
|
||||||
|
|
Loading…
Reference in New Issue