[cmake-developers] [CMake 0013069]: Ninja: CMAKE_<LANG>_FLAGS_<TYPE> flags not applied to executable commands

Mantis Bug Tracker mantis at public.kitware.com
Wed Mar 28 16:21:52 EDT 2012


The following issue has been SUBMITTED. 
====================================================================== 
http://public.kitware.com/Bug/view.php?id=13069 
====================================================================== 
Reported By:                Ben Boeckel
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   13069
Category:                   CMake
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2012-03-28 16:21 EDT
Last Modified:              2012-03-28 16:21 EDT
====================================================================== 
Summary:                    Ninja: CMAKE_<LANG>_FLAGS_<TYPE> flags not applied
to executable commands
Description: 
When compiling with custom flags which are applied per-build type, they are not
added to the linker line with the Ninja generator. The commands run by ninja and
make are pasted below for comparison.

With ninja:
[1/6] /usr/lib64/ccache/gcc   -g -O0 -pg -fprofile-arcs -ftest-coverage
-DFLAG=\"Debug\" -MMD -MF CMakeFiles/lib.dir/lib.c.o.d -o
CMakeFiles/lib.dir/lib.c.o   -c ../lib.c
[2/6] /usr/lib64/ccache/gcc  -Dlib_shared_EXPORTS -g -O0 -pg -fprofile-arcs
-ftest-coverage -DFLAG=\"Debug\" -fPIC -MMD -MF
CMakeFiles/lib_shared.dir/lib.c.o.d -o CMakeFiles/lib_shared.dir/lib.c.o   -c
../lib.c
[3/6] : && /usr/lib64/ccache/gcc  -fPIC -g -O0 -pg -fprofile-arcs
-ftest-coverage -DFLAG=\"Debug\"   -shared -Wl,-soname,liblib_shared.so -o
liblib_shared.so CMakeFiles/lib_shared.dir/lib.c.o  && :
[4/6] : && /home/boeckb/code/cmake/build/bin/cmake -E remove liblib.a &&
/usr/bin/ar cr liblib.a  CMakeFiles/lib.dir/lib.c.o && /usr/bin/ranlib liblib.a
&& :
[5/6] /usr/lib64/ccache/gcc   -g -O0 -pg -fprofile-arcs -ftest-coverage
-DFLAG=\"Debug\" -MMD -MF CMakeFiles/flags.dir/flags.c.o.d -o
CMakeFiles/flags.dir/flags.c.o   -c ../flags.c
[6/6] : && /usr/lib64/ccache/gcc  -fPIC   CMakeFiles/flags.dir/flags.c.o  -o
flags -rdynamic liblib.a && :

With Unix Makefiles:
/usr/lib64/ccache/gcc   -g -O0 -pg -fprofile-arcs -ftest-coverage
-DFLAG=\"Debug\"   -o CMakeFiles/lib.dir/lib.c.o   -c
/home/boeckb/misc/code/sb/ninja/lib.c
/usr/bin/ar cr liblib.a  CMakeFiles/lib.dir/lib.c.o
/usr/bin/ranlib liblib.a
/usr/lib64/ccache/gcc   -g -O0 -pg -fprofile-arcs -ftest-coverage
-DFLAG=\"Debug\"   -o CMakeFiles/flags.dir/flags.c.o   -c
/home/boeckb/misc/code/sb/ninja/flags.c
/usr/lib64/ccache/gcc  -g -O0 -pg -fprofile-arcs -ftest-coverage
-DFLAG=\"Debug\"    CMakeFiles/flags.dir/flags.c.o  -o flags -rdynamic liblib.a
/usr/lib64/ccache/gcc  -Dlib_shared_EXPORTS -g -O0 -pg -fprofile-arcs
-ftest-coverage -DFLAG=\"Debug\" -fPIC   -o CMakeFiles/lib_shared.dir/lib.c.o  
-c /home/boeckb/misc/code/sb/ninja/lib.c
/usr/lib64/ccache/gcc  -fPIC -g -O0 -pg -fprofile-arcs -ftest-coverage
-DFLAG=\"Debug\"   -shared -Wl,-soname,liblib_shared.so -o liblib_shared.so
CMakeFiles/lib_shared.dir/lib.c.o

Steps to Reproduce: 
Attached tarball with CMakeLists and shell script used to track down the error.

Run the shell script as:

cmake=/path/to/cmake sh mktrees.sh

Additional Information: 
cmake-2.8.8-git58db6ac
ninja-master-gitabd33d5
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2012-03-28 16:21 Ben Boeckel    New Issue                                    
2012-03-28 16:21 Ben Boeckel    File Added: ninja-flags.tar.bz2                 
  
======================================================================




More information about the cmake-developers mailing list