The following issue has been SUBMITTED. 
====================================================================== 
http://public.kitware.com/Bug/view.php?id=13299 
====================================================================== 
Reported By:                Stephen Kelly
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   13299
Category:                   CMake
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2012-06-13 16:06 EDT
Last Modified:              2012-06-13 16:06 EDT
====================================================================== 
Summary:                    Build should abort if moc fails
Description: 

Add a signal which is templated (which causes moc to return an error), and run
the unit test. Instead of aborting when moc notifies an error, the build fails
later when attempting to include the generated file (using make -j1), as below.

As a failed moc run does not overwrite the target file, an old file can be left
behind, causing even the #include to work properly, hiding the bug. 
                                                   
Generating private_slot.moc                                                     
                                                          
/home/stephen/dev/src/cmake/Tests/QtAutomoc/private_slot.h:15: Error: Template
function as signal or slot                                  
AUTOMOC: error: process for
/home/stephen/dev/src/cmake/Tests/QtAutomoc/build/private_slot.moc failed:
/home/stephen/dev/src/cmake/Tests/QtAutomoc/private_slot.h:15: Error: Template
function as signal or slot

Generating sub/moc_bar.cpp
Generating moc_xyz.cpp                                                          
                                                          
Generating yaf_p.moc                                                            
                                                          
Generating moc_calwidget.cpp                                                    
                                                          
Generating moc_foo.cpp                                                          
                                                          
returning failed..                                                              
                                                          
[ 28%] Built target foo_automoc
Scanning dependencies of target foo
[ 35%] Building CXX object CMakeFiles/foo.dir/main.cpp.o                        
                                                          
[ 42%] Building CXX object CMakeFiles/foo.dir/calwidget.cpp.o                   
                                                          
[ 50%] Building CXX object CMakeFiles/foo.dir/foo.cpp.o                         
                                                          
[ 57%] Building CXX object CMakeFiles/foo.dir/blub.cpp.o                        
                                                          
[ 64%] Building CXX object CMakeFiles/foo.dir/bar.cpp.o                         
                                                          
[ 71%] Building CXX object CMakeFiles/foo.dir/abc.cpp.o                         
                                                          
[ 78%] Building CXX object CMakeFiles/foo.dir/xyz.cpp.o                         
                                                          
[ 85%] Building CXX object CMakeFiles/foo.dir/yaf.cpp.o                         
                                                          
[ 92%] Building CXX object CMakeFiles/foo.dir/private_slot.cpp.o                
                                                          
/home/stephen/dev/src/cmake/Tests/QtAutomoc/private_slot.cpp:21:28: fatal error:
private_slot.moc: No such file or directory               
compilation terminated.
make[2]: *** [CMakeFiles/foo.dir/private_slot.cpp.o] Error 1
make[1]: *** [CMakeFiles/foo.dir/all] Error 2
make: *** [all] Error 2
makeobj[0]: Leaving directory
`/home/stephen/dev/src/cmake/Tests/QtAutomoc/build'
Qt( 4.8 ) KDE ( ) 
stephen@hal:~/dev/src/cmake/Tests/QtAutomoc/build{master}$ git diff
diff --git a/Tests/QtAutomoc/private_slot.h b/Tests/QtAutomoc/private_slot.h
index 28e5448..b5177e3 100644
--- a/Tests/QtAutomoc/private_slot.h
+++ b/Tests/QtAutomoc/private_slot.h
@@ -12,6 +12,9 @@ class PrivateSlot : public QObject
 public:
   PrivateSlot(QObject *parent = 0);
 
+signals:
+  template<int> void someSignal();
+
 private:
   PrivateSlotPrivate * const d;
   Q_PRIVATE_SLOT(d, void privateSlot())

====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2012-06-13 16:06 Stephen Kelly  New Issue                                    
======================================================================

--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers

Reply via email to