[cmake-developers] [CMake 0015940]: There doesn't appear to be a cross-platform way to set flags to be used at compile time but not at link time

Mantis Bug Tracker mantis at public.kitware.com
Thu Jan 28 18:32:05 EST 2016


The following issue has been SUBMITTED. 
====================================================================== 
https://public.kitware.com/Bug/view.php?id=15940 
====================================================================== 
Reported By:                Guy Harris
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   15940
Category:                   CMake
Reproducibility:            N/A
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2016-01-28 18:32 EST
Last Modified:              2016-01-28 18:32 EST
====================================================================== 
Summary:                    There doesn't appear to be a cross-platform way to
set flags to be used at compile time but not at link time
Description: 
It appears that if a flag is added to CMAKE_C_FLAGS, it will be used not only at
compile time but also at link time, at least for some platform/compiler
combinations.

Many such flags are, at best, not helpful at link time, and clutter the command
line used for linking.  Some might also not work at link time.

Unix make, and autotools, keep compiler flags (CFLAGS/CXXFLAGS/etc.) and linker
flags (LDFLAGS) separate.  CMake should provide a way to do the same.
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2016-01-28 18:32 Guy Harris     New Issue                                    
======================================================================



More information about the cmake-developers mailing list