Skip to content
Snippets Groups Projects
Commit 133cbd1a authored by Rashad Kanavath's avatar Rashad Kanavath
Browse files

PKG: XDK: fix is executable2 function for windows (check .exe and .dll)

parent fe86eeed
No related branches found
No related tags found
No related merge requests found
...@@ -266,23 +266,20 @@ function(func_is_file_a_symbolic_link file result_var1 result_var2) ...@@ -266,23 +266,20 @@ function(func_is_file_a_symbolic_link file result_var1 result_var2)
get_filename_component(file_full "${file}" ABSOLUTE) get_filename_component(file_full "${file}" ABSOLUTE)
string(TOLOWER "${file_full}" file_full_lower) string(TOLOWER "${file_full}" file_full_lower)
# If file name ends in .exe on Windows, *assume* executable: # If file name ends in .exe on Windows, *assume* executable.
# # And If file name ends in .dll on Windows, *assume* libary.
if(WIN32 AND NOT UNIX) if(WIN32 AND NOT UNIX)
if("${file_full_lower}" MATCHES "\\.lnk$") if("${file_full_lower}" MATCHES "(\\.exe|\\.dll)$")
set(${result_var1} 1 PARENT_SCOPE) set(${result_var} 1 PARENT_SCOPE)
#Assuming the file is linked to a file with same name without .lnk extension
get_filename_component(name_we_lnk "${file_full_lower}" NAME_WE)
set(${result_var2} "${name_we_lnk}" PARENT_SCOPE)
return() return()
endif() endif()
# A clause could be added here that uses output or return value of dumpbin # A clause could be added here that uses output or return value of dumpbin
# to determine ${result_var}. In 99%+? practical cases, the exe name # to determine ${result_var}. In 99%+? practical cases, the exe name
# match will be sufficient... # match will be sufficient...
# #
endif() endif()
# Use the information returned from the Unix shell command "file" to # Use the information returned from the Unix shell command "file" to
# determine if ${file_full} should be considered an executable file... # determine if ${file_full} should be considered an executable file...
# #
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment