[CMake] Making CMake *not* use -isystem at all

Alexander Neundorf a.neundorf-work at gmx.net
Mon Dec 7 16:05:25 EST 2015


On Monday, December 07, 2015 15:39:40 Attila Krasznahorkay wrote:
> Dear All,
> 
> I'm still debugging the performance problems of our build. But now I 
bumped
> into another surprising thing.
> 
> Our "highest level" packages can depend on a *lot* of low level 
packages.
> The one I'm testing now depends on more than 180 of them.
> 
> This generates >180 -isystem flags for the compilation lines. But I 
found a
> very surprising thing. If I replace all of these -isystem flags with -I
> ones by simply modifying the flags.cmake files that CMake generated 
for me,
> the build time of my code is cut to less than half of what it is when 
using
> -isystem.
> 
> So... How do I tell CMake to forget about using -isystem all together, 
and
> take all my include directories with -I?
> 
> Not using SYSTEM in target_include_directories and 
include_directories
> doesn't seem to make a difference. I still get all my out-of-source
> directories with -isystem. I even tried setting
> CMAKE_INCLUDE_SYSTEM_FLAG_CXX and 
CMAKE_INCLUDE_SYSTEM_FLAG_C to "-I "
> forcefully. But this didn't help either. Neither did explicitly unsetting
> these variables.

I would have expected this to work.
Maybe set them to -I on the initial cmake run ?

Alex

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20151207/8f8db3ae/attachment.html>


More information about the CMake mailing list