View Issue Details [ Jump to Notes ] | [ Print ] |
ID | Project | Category | View Status | Date Submitted | Last Update |
0014520 | CMake | CMake | public | 2013-10-29 04:08 | 2014-06-02 08:37 |
|
Reporter | Adrien Bruneton | |
Assigned To | jschueller | |
Priority | normal | Severity | major | Reproducibility | always |
Status | closed | Resolution | fixed | |
Platform | All | OS | All | OS Version | All |
Product Version | CMake 2.8.12 | |
Target Version | | Fixed in Version | CMake 3.0 | |
|
Summary | 0014520: 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. |
Tags | No tags attached. |
|
Attached Files | patch-UseSWIG.patch [^] (62 bytes) 2013-10-29 04:08 [Show Content] [Hide Content]150a151
> list(REMOVE_DUPLICATES cmake_include_directories)
|
|