[cmake-developers] [CMake 0014795]: flex_target: some errors silently ignored

Mantis Bug Tracker mantis at public.kitware.com
Fri Mar 7 06:15:23 EST 2014


The following issue has been SUBMITTED. 
====================================================================== 
http://public.kitware.com/Bug/view.php?id=14795 
====================================================================== 
Reported By:                trsystran
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   14795
Category:                   Modules
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2014-03-07 06:15 EST
Last Modified:              2014-03-07 06:15 EST
====================================================================== 
Summary:                    flex_target: some errors silently ignored
Description: 
Current flex version (v2.5.37) sometimes generates an empty output file in case
of error.
(at least when m4 program is missing: "flex: fatal internal error, exec of
/usr/bin/m4 failed")

In such case flex returns a non zero return code, and cmake correctly reports a
target build failure, however flex did generate the output file: an empty file.

This is an issue: if we do two "make" in a row the first one will correctly
fail, but the second one will think the target is generated (since the file
exists) and proceed without error. It will maybe fail later when symbols are
missing (or not if we only build dynamic libraries).

Steps to Reproduce: 
* install flex
* remove m4
* use flex_target
find_package(FLEX "2.5.37" QUIET REQUIRED)
flex_target(Test test.l ${CMAKE_CURRENT_BINARY_DIR}/test.c)
create_library(test SHARED ${FLEX_test_OUTPUTS})
* run cmake
* run "make; make"
* result: the library "test" is build without error on the second make; it
shouldn't.

Additional Information: 
Maybe we should report this to flex, but in any case in order to support older
versions we should still have a workaround in FindFLEX.cmake: delete the output
in case of flex error.
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2014-03-07 06:15 trsystran      New Issue                                    
======================================================================



More information about the cmake-developers mailing list