[cmake-developers] Module.GenerateExportHeader crash
Bill Hoffman
bill.hoffman at kitware.com
Tue Aug 14 10:47:31 EDT 2012
On 8/14/2012 10:34 AM, Stephen Kelly wrote:
> Thanks. This is something I probably would not have even known to try.
>
> Bill, aside from the above requests I made previously, could you see if this
> makes a difference?
I think you have found a bug in the ninja generator. This fixes the crash:
(not sure why it does not crash on other compilers...)
diff --git a/Source/cmNinjaTargetGenerator.cxx
b/Source/cmNinjaTargetGenerator.c
index 3532c8b..58f4397 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -398,7 +398,10 @@ cmNinjaTargetGenerator
if(useClDeps)
{
- std::string cl = mf->GetDefinition("CMAKE_C_COMPILER");
+ std::string compiler = "CMAKE_";
+ compiler += lang;
+ compiler += "_COMPILER";
+ std::string cl = mf->GetDefinition(compiler.c_str());
cl = "\"" + cl + "\" ";
cmdLine = clDepsBinary + " " + lang + " $in \"$DEP_FILE\" $out "
+ clShowPrefix + " " + cl + cmdLine;
As for commenting out tests. Just don't do it. Ask for help from the
person running the dashboard. Might take a bit longer, but we will end
up with higher quality code that works everywhere. This crash on ninja
would certainly have crashed cmake for somebody someday.
-Bill
More information about the cmake-developers
mailing list