Conversation
Note: this makes the "install" target install the compiler rt into the compiler's runtime directory. IMO, it's what "install" is supposed to do. If you want to avoid modifing the runtime directory for some reasons, you can still do "dist" without "install".
|
Personally I think that "install" should only ever modify things under |
i tend to disagree. but i pushed a change to avoid modifying the host compiler's resource dir. |
cmake/wasi-sdk-sysroot.cmake
Outdated
| cmake_path(IS_PREFIX CMAKE_INSTALL_PREFIX ${clang_resource_dir} NORMALIZE install_resource_dir) | ||
| if(install_resource_dir) | ||
| install(DIRECTORY ${wasi_resource_dir}/lib | ||
| USE_SOURCE_PERMISSIONS | ||
| DESTINATION ${clang_resource_dir}) | ||
| else() | ||
| message(STATUS "The resource dir (${clang_resource_dir}) will not be updated by the install target because it's out of CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}") | ||
| endif() |
There was a problem hiding this comment.
This to me seems odd to me to have a conditional installation. Could an option be added to modify the host compiler's resource-dir and if that's turned off then the preexisting install location is used? (or something similar to it, probalby not the exact same structure with a clang version that isn't guaranteed to match something)
There was a problem hiding this comment.
i'm a bit confused because i just tried to follow your suggestion and you are now saying it's odd. :-)
how about the last push?
There was a problem hiding this comment.
The first version of this PR unconditionally modified the host compiler resource-dir which I felt was surprising since it was modifying things outside of CMAKE_INSTALL_PREFIX. The second version of this PR, which this comment was targetting, did nothing by default and happened to install things if CMAKE_INSTALL_PREFIX lined up. I found that surprising as well because it's not documented and just a status message can be easily lost in configure output.
Third version of this PR makes more sense to me. Something is always installed and it always shows up somewhere, and an opt-in is enabled to perform a non-standard installation to put something outside of the installation prefix.
Note: this makes the "install" target install the compiler rt into the compiler's runtime directory. IMO, it's what "install" is supposed to do. If you want to avoid modifing the runtime directory for some reasons, you can still do "dist" without "install".