/showIncludes option added automatically

Hi everyone,

I am using cmake 3.23 with Ninja generator on Windows.
clang-cl compiler is in use.

Somehow I can see in the build log that /showIncludes has been added project wide as a compilation flag and not by our cmake code.
Where does it come from?

After doing some search I can see the following in file: “C:\Program Files\CMake\share\cmake-3.22\Modules\Platform\Windows-Intel-CXX.cmake”

if(“${CMAKE_SOURCE_DIR}${CMAKE_BINARY_DIR}” MATCHES " ")
set(CMAKE_DEPFILE_FLAGS_CXX “/showIncludes”)
set(CMAKE_CXX_DEPFILE_FORMAT msvc)
endif()

Does it have something to do?

Thanks,
Serge

Yes, it’s how Ninja knows of all headers that are included for each compile so that it knows which files to keep an eye on to know when it needs to rerun compilations when they change.

1 Like

Ok thanks Ben.