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>
This commit is contained in:
parent
6d8ca723d0
commit
2a65e92da2
|
@ -33,6 +33,10 @@ endif()
|
|||
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
|
||||
|
||||
if(WIN32)
|
||||
include(RemoveStrawberryPerlFromPATH)
|
||||
endif()
|
||||
|
||||
if(UPDATE_APPCAST)
|
||||
include(UpdateAppcast)
|
||||
endif()
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
# 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:
|
Loading…
Reference in New Issue