[CMake] Use <UNIX|WINDOWS>_COMMAND with separate_arguments
NATIVE_COMMAND is only available since CMake 3.9.
@@ -355,7 +355,11 @@ function(check_link_libraries variable)
string(REGEX REPLACE "\r?\n" ";" output_lines "${COMMAND_OUTPUT}")
foreach(line IN LISTS output_lines)
if(line MATCHES "${LINKER_REGEX}" AND NOT line MATCHES "${EXCLUDE_REGEX}")
- separate_arguments(args NATIVE_COMMAND "${line}")
+ if(UNIX)
+ separate_arguments(args UNIX_COMMAND "${line}")
+ else()
+ separate_arguments(args WINDOWS_COMMAND "${line}")
+ endif()
list(GET args 0 cmd)
endif()
if("${cmd}" MATCHES "${LINKER_REGEX}")
