MantisBT - CMake | ||||||||||
View Issue Details | ||||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | |||||
0007643 | CMake | Modules | public | 2008-09-09 20:25 | 2016-06-10 14:30 | |||||
Reporter | Preston A. Elder | |||||||||
Assigned To | Brad King | |||||||||
Priority | normal | Severity | feature | Reproducibility | always | |||||
Status | closed | Resolution | moved | |||||||
Platform | OS | OS Version | ||||||||
Product Version | CMake-2-6 | |||||||||
Target Version | Fixed in Version | |||||||||
Summary | 0007643: Cmake should add expanded compiler flag support. | |||||||||
Description | From the email chain: >> As I said, there are other things that need to be done such as: >> - Adjusting warning levels (CMAKE_WARN_LEVEL=(None|Full|Standard) ) >> - Forcing a 32-bit or 64-bit compile >> - Allowing for platform-specific builds if possible (ie. don't maintain >> i386 compatibility, compile specifically for i686). >> >> Most of these can be done in all supported compilers, but the flags for >> doing so are different per-compiler. Since the Platform directory >> exists (thanks for pointing it out, I didn't see it before), is there >> any thoughts on an effort to expand this to more than just optimization >> and debug flags? I've been wanting to implement something like this for years, but haven't had the time to actually do it. The feature would work in terms of directory, target, and source file properties. It would be similar to the COMPILE_DEFINITIONS properties: http://www.cmake.org/Wiki/CMake_2.6_Notes#Preprocessor_Definitions [^] http://www.cmake.org/HTML/cmake-2.6.html#prop_dir:COMPILE_DEFINITIONS [^] http://www.cmake.org/HTML/cmake-2.6.html#prop_tgt:COMPILE_DEFINITIONS [^] http://www.cmake.org/HTML/cmake-2.6.html#prop_sf:COMPILE_DEFINITIONS [^] and their per-configuration equivalents. Such a property might accept one out of an enumerated list of pre-defined possible values. Each value would map to the appropriate flag for the native tool. It might look something like this: # Apply to all targets in this directory and below. set_directory_properties(PROPERTIES OPTIMIZATION_LEVEL_DEBUG none # no optimizations for Debug OPTIMIZATION_LEVEL_RELEASE max # max optimizations for Release OPTIMIZATION_LEVEL default # compiler default for other configs WARNING_LEVEL none # disable all warnings in all configurations ) # apply to 'tiny' executable, overriding directory default set_property(TARGET tiny PROPERTY OPTIMIZATION_LEVEL size # optimize for size in all configurations ) Of course we could create commands or macros to shorten the syntax for common cases. -Brad | |||||||||
Steps To Reproduce | ||||||||||
Additional Information | ||||||||||
Tags | No tags attached. | |||||||||
Relationships |
| |||||||||
Attached Files | ||||||||||
Issue History | ||||||||||
Date Modified | Username | Field | Change | |||||||
2008-09-09 20:25 | Preston A. Elder | New Issue | ||||||||
2008-09-11 10:20 | Bill Hoffman | Status | new => assigned | |||||||
2008-09-11 10:20 | Bill Hoffman | Assigned To | => Brad King | |||||||
2009-04-03 12:23 | MrDoomMaster | Note Added: 0015901 | ||||||||
2012-08-13 10:36 | Brad King | Status | assigned => backlog | |||||||
2012-08-13 10:36 | Brad King | Note Added: 0030495 | ||||||||
2013-11-02 11:22 | Stephen Kelly | Relationship added | related to 0003811 | |||||||
2016-06-10 14:27 | Kitware Robot | Note Added: 0041449 | ||||||||
2016-06-10 14:27 | Kitware Robot | Status | backlog => resolved | |||||||
2016-06-10 14:27 | Kitware Robot | Resolution | open => moved | |||||||
2016-06-10 14:30 | Kitware Robot | Status | resolved => closed |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|