When COMPILER_RT_BUILD_MEMPROF is disabled, the memprof headers should not be installed.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Actually, MEMPROF_HEADERS is set when COMPILER_RT_BUILD_MEMPROF is enabled.
If we use install(FILES ${MEMPROF_HEADERS}, the interface header won't be install when COMPILER_RT_BUILD_MEMPROF is disabled.
But we decide to only install sanitizer/memprof_interface.h and not to install MemProfData.inc, so here we guard the installation of sanitizer/memprof_interface.h with COMPILER_RT_BUILD_MEMPROF.
Could can set MEMPROF_HEADERS only including sanitizer/memprof_interface.h?
Other sanitizers are using *_HEADERS vars for this. I see that MEMPROF_HEADERS also includes MemProfData.inc — is this something that could be potentially useful being installed?
As @tejohnson mentioned in https://reviews.llvm.org/D136067, MemProfData.inc won't be called by user code, that's why we think only installing the interface header is enough for now.
Let's wait for tejohnson's option about this change.
Yeah it is unfortunate that we need to structure the code here a bit differently than the other headers, but I'm not sure the implications of putting MemProfData.inc into a different install directory than the directory it comes from. In the other cases the headers all come out of the same subdirectory. And I don't think it should be needed in any case.
So lgtm for this fix.