summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalUnixMakefileGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2002-09-10 19:40:41 (GMT)
committerBrad King <brad.king@kitware.com>2002-09-10 19:40:41 (GMT)
commitde48dbbf7cb77315645566f14bed088d44585546 (patch)
treec881f89199af2c797b30438f9c6dbe9969e2c42b /Source/cmGlobalUnixMakefileGenerator.cxx
parent14f021185829d70840f3e000fba08496f9f8f26d (diff)
downloadCMake-de48dbbf7cb77315645566f14bed088d44585546.zip
CMake-de48dbbf7cb77315645566f14bed088d44585546.tar.gz
CMake-de48dbbf7cb77315645566f14bed088d44585546.tar.bz2
ERR: Fixes for comeau compiler. NULL is a pointer of type void*, and cannot be compared directly with other pointer types. We use 0 instead. Also changed putenv to setenv for comeau on linux.
Diffstat (limited to 'Source/cmGlobalUnixMakefileGenerator.cxx')
-rw-r--r--Source/cmGlobalUnixMakefileGenerator.cxx21
1 files changed, 19 insertions, 2 deletions
diff --git a/Source/cmGlobalUnixMakefileGenerator.cxx b/Source/cmGlobalUnixMakefileGenerator.cxx
index d3dd4e9..883e7c2 100644
--- a/Source/cmGlobalUnixMakefileGenerator.cxx
+++ b/Source/cmGlobalUnixMakefileGenerator.cxx
@@ -14,6 +14,7 @@
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
+
#include "cmGlobalUnixMakefileGenerator.h"
#include "cmLocalUnixMakefileGenerator.h"
#include "cmMakefile.h"
@@ -34,19 +35,35 @@ void cmGlobalUnixMakefileGenerator::EnableLanguage(const char* lang,
static char envCC[5000];
if(mf->GetDefinition("CMAKE_CXX_COMPILER"))
{
+#if !defined(_WIN32) && defined(__COMO__)
+ std::string env = "${CMAKE_CXX_COMPILER}";
+ mf->ExpandVariablesInString(env);
+ strncpy(envCXX, env.c_str(), 4999);
+ envCXX[4999] = 0;
+ setenv("CXX", envCXX, 1);
+#else
std::string env = "CXX=${CMAKE_CXX_COMPILER}";
mf->ExpandVariablesInString(env);
strncpy(envCXX, env.c_str(), 4999);
envCXX[4999] = 0;
putenv(envCXX);
+#endif
}
if(mf->GetDefinition("CMAKE_C_COMPILER"))
{
+#if !defined(_WIN32) && defined(__COMO__)
+ std::string env = "${CMAKE_C_COMPILER}";
+ mf->ExpandVariablesInString(env);
+ strncpy(envCC, env.c_str(), 4999);
+ envCC[4999] = 0;
+ setenv("CC", envCC, 1);
+#else
std::string env = "CC=${CMAKE_C_COMPILER}";
mf->ExpandVariablesInString(env);
strncpy(envCC, env.c_str(), 4999);
envCC[4999] = 0;
putenv(envCC);
+#endif
}
std::string output;
std::string root
@@ -65,7 +82,7 @@ void cmGlobalUnixMakefileGenerator::EnableLanguage(const char* lang,
cmSystemTools::ConvertToOutputPath(mf->GetHomeOutputDirectory()).c_str());
std::string fpath = mf->GetHomeOutputDirectory();
fpath += "/CCMakeSystemConfig.cmake";
- mf->ReadListFile(NULL,fpath.c_str());
+ mf->ReadListFile(0,fpath.c_str());
this->SetLanguageEnabled("C");
}
// if CXX
@@ -77,7 +94,7 @@ void cmGlobalUnixMakefileGenerator::EnableLanguage(const char* lang,
cmSystemTools::ConvertToOutputPath(mf->GetHomeOutputDirectory()).c_str());
std::string fpath = mf->GetHomeOutputDirectory();
fpath += "/CXXCMakeSystemConfig.cmake";
- mf->ReadListFile(NULL,fpath.c_str());
+ mf->ReadListFile(0,fpath.c_str());
this->SetLanguageEnabled("CXX");
}
}