acts-project / vecmem

Vectorised data model base and helper classes.
https://acts-project.github.io/vecmem/
Mozilla Public License 2.0
19 stars 13 forks source link

SYCL Build Dependency Generation (2023.12.02.) #249

Closed krasznaa closed 11 months ago

krasznaa commented 11 months ago

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.)

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: