ENVIRONMENT_MODIFICATION uses host rather than target platform separator for path_list_... operations
The ENVIRONMENT_MODIFICATION
test property added in CMake 3.22 supports path_list_append
and path_list_prepend
operations. The separator used for these is documented as "using the platform-specific list separator", but it doesn't specify whether the host or target platform is the determining factor. In a cross-compiling scenario where tests may be run with an emulator (see the CROSSCOMPILING_EMULATOR
target property), this distinction could be important.
Looking at the implementation, the code uses a simple #ifdef WIN32
, which means the host platform is what determines the separator. This seems questionable to me, it seems more likely that users would expect the target platform to be the determining factor. I don't know if it is already too late to change it, unless we consider this a bug rather than a behavior change. At the very least, we should clearly document which of the two is used.