[cmake-developers] [CMake 0015243]: /EHs-c- or /EHs- /EHc- as COMPILE_FLAGS target property does not remove /EHsc from the global CMAKE_CXX_FLAGS

Mantis Bug Tracker mantis at public.kitware.com
Tue Nov 11 14:24:18 EST 2014


The following issue has been SUBMITTED. 
====================================================================== 
http://www.cmake.org/Bug/view.php?id=15243 
====================================================================== 
Reported By:                Rodrigo Hernandez
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   15243
Category:                   CMake
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2014-11-11 14:24 EST
Last Modified:              2014-11-11 14:24 EST
====================================================================== 
Summary:                    /EHs-c- or /EHs- /EHc- as COMPILE_FLAGS target
property does not remove /EHsc from the global CMAKE_CXX_FLAGS
Description: 
Sometimes when adding external projects replacing /EHsc with /EHs-c- to disable
exceptions on CMAKE_CXX_FLAGS is not an option because it may break the external
project, but when adding /EHs-c- or /EHs- /EHc- to the COMPILE_FLAGS property of
the local project, the /EHsc flag remains, causing compiler command line
warnings:

cl : Command line warning D9025: overriding '/EHs' with '/EHs-'
cl : Command line warning D9025: overriding '/EHc' with '/EHc-'

This does not seem to happen when /GR- is set, in that case the global flag from
CMAKE_CXX_FLAGS seems to vanish.

Steps to Reproduce: 
add_executable( test test.cpp )
set_target_properties(test PROPERTIES COMPILE_FLAGS "/EHs-c- /D_HAS_EXCEPTIONS=0
/GR-")


Additional Information: 
The provided file contains a minimal project on which the issue is reproduced.
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2014-11-11 14:24 Rodrigo HernandezNew Issue                                    
2014-11-11 14:24 Rodrigo HernandezFile Added: NoExceptions.zip                  
 
======================================================================



More information about the cmake-developers mailing list