Notes |
|
(0011351)
|
Matthew Hungerford
|
2008-04-15 16:29
|
|
This issue is plaguing our use of cmake with visual studio 2005. Even if we edit window_cl.cmake in share/modules/platform to edit cmake_cxx_flags_init to remove EHsc, and CMAKE_CXX_FLAGS (and CMAKE_CXX_FLAGS_DEBUG) don't contain any instance of GX or EHsc, the system still defaults to /EHsc. If we set /EHa, it correctly goes to /EHa. It looks as if when nothing is set, the VS8 generator fills exceptionhandling=false instead of exceptionhandling=0 (from the fix in cmLocalVisualStudio7Generator.cxx). Fix from http://www.cmake.org/Bug/view.php?id=6440 [^] (id=0006440) works. Effects 2.4.8 and 2.6.0RC8. |
|
|
(0011396)
|
Gerhard Grimm
|
2008-04-16 11:22
(edited on: 2008-04-16 11:25) |
|
A similar problem exists in the Visual Studio .NET 2003 generator of CMake 2.6.0-RC8. With /EHa specified as exception handling option instead of /EHsc, it generates ExceptionHandling="TRUE", where it should read ExceptionHandling="FALSE", since MSVC 7.1 always interprets "TRUE" as /EHsc.
CMake 2.5-20071119 was working correctly regarding this issue.
|
|
|
(0011407)
|
David Cole
|
2008-04-17 11:20
|
|
Fixed in CVS HEAD of CMake:
/cvsroot/CMake/CMake/Source/cmLocalVisualStudio7Generator.cxx,v <-- Source/cmLocalVisualStudio7Generator.cxx
new revision: 1.223; previous revision: 1.222
Assigning to Bill for merging to the CMake-2-6 branch.
ggrimm, is there a "/GX" in your CMAKE_CXX_FLAGS? That would also turn on ExceptionHandling even if you specify "/EHa" instead of "/EHsc" -- you may need to remove a /GX as well... If that's not the case for you, could you please submit a small sample project that demonstrates your problem? |
|
|
(0011408)
|
David Cole
|
2008-04-17 11:21
|
|
Bill, could you merge to CMake-2-6? |
|
|
(0011410)
|
Gerhard Grimm
|
2008-04-17 12:23
|
|
Hi David, I've attached a minimal sample. When using the Visual Studio .NET 2003 generator (using config_mvs7.bat in the "build" directory), the compiler will issue warning D4025 (which can't be suppressed, since it's a "command line warning").
When using the NMake Makefile generator (using config_nmake.bat), no such warning will appear during the build. |
|
|
(0011429)
|
Matthew Hungerford
|
2008-04-18 10:57
|
|
Tried the nightly build Window 2.7.20080418, and now exception handling works correctly (in that it is now disabled when we have no /GX /EHsc in the CMake_Flags). Looks great, hope it makes the 2.6 final release :) . |
|
|
(0011444)
|
Gerhard Grimm
|
2008-04-21 03:31
(edited on: 2008-04-21 03:32) |
|
Hi David, I've tested CMake 2.7-20080421, it still exhibits the problem when using Visual Studio .NET 2003.
|
|
|
(0011447)
|
Bill Hoffman
|
2008-04-21 07:59
|
|
ggrimm, can you please provide a very small example that shows the problem? |
|
|
(0011448)
|
Gerhard Grimm
|
2008-04-21 08:10
|
|
Hi Bill, as stated in note 0011410 above, I've already attached a sample to this issue (CMakeBug.zip). I'm afraid it can't be done any simpler than with a single target and a single source file... |
|
|
(0011449)
|
Bill Hoffman
|
2008-04-21 08:11
|
|
Never mind, I did not notice the example already attached. We will re-try with vs 2003 sounds like it works for vs2500. |
|
|
(0011461)
|
Bill Hoffman
|
2008-04-21 14:51
|
|
OK, I found it...
This was a much bigger bug than what I thought it was...
Your flags in the cache were being ignored altogether! So, it was actually correctly turning exceptions on, because it was getting the /GX flag. I have checked in a fix that should solve the problem. |
|
|
(0011463)
|
Bill Hoffman
|
2008-04-21 15:22
|
|
This should be fixed now. |
|