GetPrerequisites: Fix handling of executable scripts

Fixes: #18667
This commit is contained in:
Alexander Grund authored and Craig Scott committed 2019-01-05 09:09:39 +11:00
1 parent 52445300d6
commit 08be74bfd7
7 files changed
+41

No files matched your search

+9
View File
@@ -660,6 +660,15 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa
return()
endif()
# Check for a script by extension (.bat,.sh,...) or if the file starts with "#!" (shebang)
file(READ ${target} file_contents LIMIT 5)
if(target MATCHES "\\.(bat|c?sh|bash|ksh|cmd)$" OR file_contents MATCHES "^#!")
message(STATUS "GetPrequisites(${target}) : ignoring script file")
# Clear var
set(${prerequisites_var} "" PARENT_SCOPE)
return()
endif()
set(gp_cmd_paths ${gp_cmd_paths}
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\14.0;InstallDir]/../../VC/bin"
"$ENV{VS140COMNTOOLS}/../../VC/bin"