[cmake-developers] [CMake 0014520]: UseSWIG module can generate too long command lines in the build chain

Mantis Bug Tracker mantis at public.kitware.com
Tue Oct 29 04:08:29 EDT 2013


The following issue has been SUBMITTED. 
====================================================================== 
http://www.cmake.org/Bug/view.php?id=14520 
====================================================================== 
Reported By:                Adrien Bruneton
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   14520
Category:                   CMake
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2013-10-29 04:08 EDT
Last Modified:              2013-10-29 04:08 EDT
====================================================================== 
Summary:                    UseSWIG module can generate too long command lines
in the build chain
Description: 
The macro SWIG_ADD_SOURCE_TO_MODULE in the standard module UseSWIG can
potentially generate too long command lines in the build chain, making the build
fail. This macro is called by SWIG_ADD_MODULE (main entry point).
The problem typically appears first under Windows (which has tighter
restrictions in terms of maximal command line length).

In complex projects it is often the case that identical include directories are
repeated several times. The CMake command INCLUDE_DIRECTORIES deals with this
situation nicely and only keeps one instance of each directory, and hence one
iteration of the "-I/a/b/c" directive. This is not the case when invoking
SWIG_ADD_MODULE: the "-I/a/b/c" directive is repeated as many times as the
(same) directory was included.

Steps to Reproduce: 
Call SWIG_ADD_MODULE macro in a subdirectory performing (many) redundant
includes.

Additional Information: 
Below a proposed patch to the file UseSWIG.cmake helping mitigating the issue.
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2013-10-29 04:08 Adrien BrunetonNew Issue                                    
2013-10-29 04:08 Adrien BrunetonFile Added: patch-UseSWIG.patch                 
  
======================================================================




More information about the cmake-developers mailing list