[CMake] Compiling multiple files, only takes the first one

Michael Jackson mike.jackson at bluequartz.net
Mon Mar 14 17:10:29 EDT 2011


YOu have this argument to gcc:

-Werror

which means treat warnings as errors. Either remove the flag or fix the warnings.
___________________________________________________________
Mike Jackson                      www.bluequartz.net
Principal Software Engineer       mike.jackson at bluequartz.net 
BlueQuartz Software               Dayton, Ohio

On Mar 14, 2011, at 5:04 PM, Enrique Izaguirre wrote:

> Hi Alex,
> 
> This is the whole output from the make. I can only see warnings:
> 
> /bin/gcc-linux  -DCOMDRIVER_EXPORTS -DBUILD_FIX_TMP -DFIX_WIN32 -DNO_ZIP -D_DEBUG -D_CONSOLE -I/home/x0148488/omapflash/cmake_build -I/home/x0148488/omapflash -I/home/x0148488/omapflash/comdriver/inc -I/home/x0148488/omapflash/target/src/boot -I/home/x0148488/omapflash/../../../usr/include/LinuxAPI -I/home/x0148488/omapflash/../../../usr/include/OtherLinuxFiles -I/home/x0148488/omapflash/common/inc   -Wall -Werror -o CMakeFiles/omap.dir/host/fastboot.c.o   -c /home/x0148488/omapflash/host/fastboot.c
> 
> /home/x0148488/omapflash/host/fastboot.c:125: warning: missing braces around initializer
> /home/x0148488/omapflash/host/fastboot.c:125: warning: (near initialization for `parity_names[5]')
> /home/x0148488/omapflash/host/fastboot.c: In function `find_named_value':
> /home/x0148488/omapflash/host/fastboot.c:206: warning: implicit declaration of function `stricmp'
> /home/x0148488/omapflash/host/fastboot.c: In function `open_device':
> /home/x0148488/omapflash/host/fastboot.c:397: warning: unused variable `timeremaining'
> /home/x0148488/omapflash/host/fastboot.c: In function `offset_and_chip_name':
> /home/x0148488/omapflash/host/fastboot.c:749: warning: unused variable `addr'
> /home/x0148488/omapflash/host/fastboot.c: In function `arg':
> /home/x0148488/omapflash/host/fastboot.c:1143: warning: unused variable `mem_addr'
> /home/x0148488/omapflash/host/fastboot.c:1201: warning: implicit declaration of function `_snprintf'
> /home/x0148488/omapflash/host/fastboot.c: At top level:
> /home/x0148488/omapflash/host/fastboot.c:76: warning: `wipe_data' defined but not used
> make[2]: *** [CMakeFiles/omap.dir/host/fastboot.c.o] Error 1
> make[2]: Leaving directory `/home/x0148488/omapflash/cmake_build'
> make[1]: *** [CMakeFiles/omap.dir/all] Error 2
> make[1]: Leaving directory `/home/x0148488/omapflash/cmake_build'
> make: *** [all] Error 2
> 
> Also the compiler command generated only shows the first file. What could be the problem? Do I have to fix the warnings?
> 
> Thanks
> 
> Enrique
> 
> 
> 
> 2011/3/14 Alexander Neundorf <a.neundorf-work at gmx.net>
> On Monday 14 March 2011, Enrique Izaguirre wrote:
> > Hello friends,
> >
> > I have a problem when I try to compile several files, for some reason it
> > takes only the first of the list to build it.
> > It displays a few warnings and at the end the following error:
> >
> > make[2]: *** [CMakeFiles/omap.dir/host/fastboot.c.o] Error 1
> > make[2]: Leaving directory `/home/x0148488/omapflash/cmake_build'
> > make[1]: *** [CMakeFiles/omap.dir/all] Error 2
> > make[1]: Leaving directory `/home/x0148488/omapflash/cmake_build'
> > make: *** [all] Error 2
> >
> > Even before doing the add_executable ( ), I display first the variable that
> > contains the list of files to build, and it indeed has all the files to
> > compile; somehow it only compiles the first one and then leave. Running
> > make with the VERVOSE=1 I can see the command, and it has only the first
> > file of the list; so CMake is generating the command wrong.
> 
> No.
> The files are built one by one after each other.
> 
> > Can you explain why only one file is compiled and not the entire list?
> 
> Maybe I'm missing something...
> Isn't the build simply stopping because of a compile error ?
> You cut away too much from the compiler output, the actual error is not
> visible in the part above.
> 
> Alex
> 
> _______________________________________________
> 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://www.cmake.org/mailman/listinfo/cmake



More information about the CMake mailing list