Bläddra i källkod

cmake: fix Windows unrecognized option link warning

This fixes a warning that could show up on some MS linkers which use a
slightly different warning message than expected.

Amends check_linker_supports_version_file to include the "unrecognized
option" warning message.
Jamie Madill 1 år sedan
förälder
incheckning
59b37d0e5b
1 ändrade filer med 1 tillägg och 1 borttagningar
  1. 1 1
      cmake/macros.cmake

+ 1 - 1
cmake/macros.cmake

@@ -86,7 +86,7 @@ function(check_linker_supports_version_file VAR)
   cmake_push_check_state()
   file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/dummy.sym" "n_0 {\n global:\n  func;\n local: *;\n};\n")
   list(APPEND CMAKE_REQUIRED_LINK_OPTIONS "-Wl,--version-script=${CMAKE_CURRENT_BINARY_DIR}/dummy.sym")
-  check_c_source_compiles("int func(void) {return 0;} int main(int argc,char*argv[]){(void)argc;(void)argv;return func();}" LINKER_SUPPORTS_VERSION_SCRIPT FAIL_REGEX "(unsupported|syntax error)")
+  check_c_source_compiles("int func(void) {return 0;} int main(int argc,char*argv[]){(void)argc;(void)argv;return func();}" LINKER_SUPPORTS_VERSION_SCRIPT FAIL_REGEX "(unsupported|syntax error|unrecognized option)")
   cmake_pop_check_state()
   set(${VAR} "${LINKER_SUPPORTS_VERSION_SCRIPT}" PARENT_SCOPE)
 endfunction()