diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2003-01-21 17:50:48 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2003-01-21 17:50:48 (GMT) |
commit | 2f4ea98a4cf35b0aa6ced86c98c4b96984ef4fb7 (patch) | |
tree | 2e7ba2c7d45537691296edc194f605f623bcc3a7 /Source/cmGlobalUnixMakefileGenerator.cxx | |
parent | 110bc04bd0125ef746ad8ea239c632831f7c5075 (diff) | |
download | CMake-2f4ea98a4cf35b0aa6ced86c98c4b96984ef4fb7.zip CMake-2f4ea98a4cf35b0aa6ced86c98c4b96984ef4fb7.tar.gz CMake-2f4ea98a4cf35b0aa6ced86c98c4b96984ef4fb7.tar.bz2 |
add a fatal error, and make sure c and c++ compilers work before using them
Diffstat (limited to 'Source/cmGlobalUnixMakefileGenerator.cxx')
-rw-r--r-- | Source/cmGlobalUnixMakefileGenerator.cxx | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/Source/cmGlobalUnixMakefileGenerator.cxx b/Source/cmGlobalUnixMakefileGenerator.cxx index 823d742..d11954e 100644 --- a/Source/cmGlobalUnixMakefileGenerator.cxx +++ b/Source/cmGlobalUnixMakefileGenerator.cxx @@ -41,11 +41,19 @@ void cmGlobalUnixMakefileGenerator::EnableLanguage(const char* lang, cmSystemTools::Error("CMAKE_C_COMPILER not set, after EnableLanguage"); return; } - std::string path = cmSystemTools::FindProgram(mf->GetDefinition("CMAKE_C_COMPILER")); + const char* cc = mf->GetDefinition("CMAKE_C_COMPILER"); + std::string path = cmSystemTools::FindProgram(cc); if(path.size() == 0) { std::string message = "your C compiler: "; - message += mf->GetDefinition("CMAKE_C_COMPILER"); + if(cc) + { + message += cc; + } + else + { + message += "(NULL)"; + } message += " was not found in your path. " "For CMake to correctly use try compile commands, the compiler must " "be in your path. Please add the compiler to your PATH environment," @@ -54,11 +62,20 @@ void cmGlobalUnixMakefileGenerator::EnableLanguage(const char* lang, } if(strcmp(lang, "CXX") == 0) { - path = cmSystemTools::FindProgram(mf->GetDefinition("CMAKE_CXX_COMPILER")); + const char* cxx = mf->GetDefinition("CMAKE_CXX_COMPILER"); + path = cmSystemTools::FindProgram(cxx); if(path.size() == 0) { std::string message = "your C++ compiler: "; - message += mf->GetDefinition("CMAKE_CXX_COMPILER"); + if(cxx) + { + message += cxx; + } + else + { + message += "(NULL)"; + } + message += " was not found in your path. " "For CMake to correctly use try compile commands, the compiler must " "be in your path. Please add the compiler to your PATH environment," |