Files
visualboyadvance-m/cmake/RemoveStrawberryPerlFromPATH.cmake
Rafael Kitover 2a65e92da2 build: remove StrawberryPerl from ENV{PATH}
On Windows, StrawberryPerl tools and libraries exposed in the PATH
environment variable can pollute and break the build, remove any such
entries for WIN32 as a startup cmake action.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2022-11-28 10:27:06 -08:00

18 lines
393 B
CMake

# Remove StrawberryPerl from the PATH environment variable due to various build
# pollution.
unset(new_path)
message("BEFORE: $ENV{PATH}")
foreach(p $ENV{PATH})
if(NOT p MATCHES "(^|\\\\)[Ss]trawberry\\\\([Pp]erl|[Cc])\\\\(.*\\\\)?[Bb]in$")
list(APPEND new_path ${p})
endif()
endforeach(
set(ENV{PATH} "${new_path}")
message("AFTER: $ENV{PATH}")
# vim:sw=4 et sts=4 ts=8: