CMake: Enable depfile for Makefiles generators

Since https://gitlab.kitware.com/cmake/cmake/-/merge_requests/8570 introduces AUTOMOC to use depfile with the Makefile generators, the depfile usage can be enabled for them in qtbase.

Change-Id: Ie18460fd2c4703ad75eb88662445ebe961d4e895
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
Orkun Tokdemir 2023-09-11 15:13:39 +02:00
parent d1a17d9655
commit 32e2a910f1

View File

@ -1165,8 +1165,15 @@ function(qt6_extract_metatypes target)
set (use_dep_files FALSE)
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.17") # Requires automoc changes present only in 3.17
if(CMAKE_GENERATOR STREQUAL "Ninja" OR CMAKE_GENERATOR STREQUAL "Ninja Multi-Config")
set(use_dep_files TRUE)
if(CMAKE_GENERATOR STREQUAL "Ninja" OR
CMAKE_GENERATOR STREQUAL "Ninja Multi-Config" OR
(CMAKE_GENERATOR MATCHES "Makefiles" AND
CMAKE_VERSION VERSION_GREATER_EQUAL "3.28"))
if(DEFINED QT_USE_CMAKE_DEPFILES)
set(use_dep_files ${QT_USE_CMAKE_DEPFILES})
else()
set(use_dep_files TRUE)
endif()
endif()
endif()