By accident I stumbled upon something that fixes the biggest problem with our SYCL build setup. That SYCL compilation doesn't respect/track header file changes.
As it turns out, in CMake 3.20 it became possible to leave dependency file generation up to the compiler(s). Without teaching the CMake C++ code about a new language. But one needs to be explicit about it.
At the same time included some further configuration for the SYCL compilers from standard CMake include files. Since the Compiler/... includes are the ones defining the CMAKE_DEPFILE_FLAGS_SYCL variables for us. (Which are the flags that CMake adds to the build to generate the dependency files.)
By accident I stumbled upon something that fixes the biggest problem with our SYCL build setup. That SYCL compilation doesn't respect/track header file changes.
As it turns out, in CMake 3.20 it became possible to leave dependency file generation up to the compiler(s). Without teaching the CMake C++ code about a new language. But one needs to be explicit about it.
At the same time included some further configuration for the SYCL compilers from standard CMake include files. Since the
Compiler/...
includes are the ones defining theCMAKE_DEPFILE_FLAGS_SYCL
variables for us. (Which are the flags that CMake adds to the build to generate the dependency files.)Relevant documentation page is: https://cmake.org/cmake/help/latest/variable/CMAKE_DEPENDS_USE_COMPILER.html Everything else I learned by reading through the CMake code...
And yes, it even works on Windows. :smile: