Bug in expanding the same genexpr multiple times on the same target
The title is descriptive enough. The targets in this repro repo all fail to compile for various reasons (marked as comments in the CMakeLists.txt
).
The genexpr expanding the INTERFACE_INCLUDE_DIRECTORIES
of Proj::Headers
only works once, and depending on who beats the other to the punch, the targets fail to compile with missing different include.
The toy repo and includes may seem contrived, this came up during the modernization of the Khronos OpenCL SDK, where the source file which includes the public headers in a mixed style is a generated source file coming from CMock (a set of Ruby scripts) and I do not have the capacity to get to the bottom of why it happens so. (I can try within the work-group, but nonetheless, this is a bug.)
Edit: I added the workaround we employed, but it's noisy.