diff options
author | Marc Chevrier <marc.chevrier@gmail.com> | 2020-10-18 16:11:27 +0200 |
---|---|---|
committer | Marc Chevrier <marc.chevrier@gmail.com> | 2020-11-29 15:25:42 +0100 |
commit | 2c71d051facad13b0a42a57066be2489d5fff6ea (patch) | |
tree | d07f850f8abc74d9df34ad885681c08d36c14472 /Modules/Compiler/GNU-CXX.cmake | |
parent | afd0f6785dc1220a07743d31699fcd9097cca46a (diff) | |
download | cmake-2c71d051facad13b0a42a57066be2489d5fff6ea.tar.gz |
Makefiles Generators: use compiler for dependencies generation
Each source compilation generates a dependencies file. These dependencies
files are consolidated in one file per target. This consolidation is done
as part of command 'cmake -E cmake_depends` launched before evaluation of
makefile dependency graph.
The consolidation uses the same approach as `CMake` dependencies management.
Fixes: #21321
Diffstat (limited to 'Modules/Compiler/GNU-CXX.cmake')
-rw-r--r-- | Modules/Compiler/GNU-CXX.cmake | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Modules/Compiler/GNU-CXX.cmake b/Modules/Compiler/GNU-CXX.cmake index fcaaeab433..24be2d72c8 100644 --- a/Modules/Compiler/GNU-CXX.cmake +++ b/Modules/Compiler/GNU-CXX.cmake @@ -1,6 +1,16 @@ include(Compiler/GNU) __compiler_gnu(CXX) + +if((NOT DEFINED CMAKE_DEPENDS_USE_COMPILER OR CMAKE_DEPENDS_USE_COMPILER) + AND CMAKE_GENERATOR MATCHES "Makefiles|WMake" + AND CMAKE_DEPFILE_FLAGS_CXX) + # dependencies are computed by the compiler itself + set(CMAKE_CXX_DEPFILE_FORMAT gcc) + set(CMAKE_CXX_DEPENDS_USE_COMPILER TRUE) +endif() + + if (WIN32) if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.6) set(CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN "-fno-keep-inline-dllexport") |