The following issue has been SUBMITTED. 
====================================================================== 
http://www.cmake.org/Bug/view.php?id=15563 
====================================================================== 
Reported By:                Alex Lamaison
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   15563
Category:                   CMake
Reproducibility:            sometimes
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2015-05-12 06:18 EDT
Last Modified:              2015-05-12 06:18 EDT
====================================================================== 
Summary:                    ABI failures are not treated as a fatal error
Description: 
With Visual Studio 2005/2008 ABI detection sometimes fails because the path to
the source file is too long.  When that happens, CMake continues configuring and
doesn't treat it as a fatal error.  Shouldn't building be aborted if ABI tests
fail?  What effect might it have on the binaries that are built?

Steps to Reproduce: 
Install CMake at the default location.

Create a CMake project at a directory several steps down from C:\, e.g
C:\Users\MyUsername\Project\My\Project.

Configure the project with CMake to use Visual Studio 2005 or 2008 as generator.

Observe log output like:
1>-- The C compiler identification is MSVC 14.0.50727
1>-- The CXX compiler identification is MSVC 14.0.50727
1>-- Check for working C compiler using: Visual Studio 8 2005 Win64
1>-- Check for working C compiler using: Visual Studio 8 2005 Win64 -- works
1>-- Detecting C compiler ABI info
1>-- Detecting C compiler ABI info - failed
1>-- Check for working CXX compiler using: Visual Studio 8 2005 Win64
1>-- Check for working CXX compiler using: Visual Studio 8 2005 Win64 -- works
1>-- Detecting CXX compiler ABI info
1>-- Detecting CXX compiler ABI info - failed

Observe that configuration continues after the ABI check failure and reports
success.  The only way to notice that ABI detection failed is to grep the log.

Additional Information: 
The reason the ABI step fails with older visual studio is that CMake adds the
full path to CMakeCXXCompilerABI.cpp as a RelativePath in the VS project.  For
example, "C:\Program Files
(x86)\CMake\share\cmake-3.2\Modules\CMakeCXXCompilerABI.cpp".  Visual Studio
converts all paths to be relative to the build directory.  Assuming a build path
of "C:\Users\MyUsername\Project\My\Project\bin", VS tries to open
"..\..\..\..\..\Program Files
(x86)\CMake\share\cmake-3.2\Modules\CMakeCXXCompilerABI.cpp" and fails because
this is longer than Windows path limits.

A workaround for this would be for CMake to copy CMakeCXXCompilerABI.cpp to the
binary directory, the way it does for the source file it uses to determine if
the compiler is working.

See https://github.com/ruslo/hunter/issues/121#issuecomment-101219535 for more
history on this issue.
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2015-05-12 06:18 Alex Lamaison  New Issue                                    
======================================================================

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers

Reply via email to