From 59b37d0e5b449adf5adbdf65ba7067de505db330 Mon Sep 17 00:00:00 2001 From: Jamie Madill Date: Sun, 5 Nov 2023 11:28:22 -0500 Subject: [PATCH] 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. --- cmake/macros.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/macros.cmake b/cmake/macros.cmake index de9680047..fa9690f85 100644 --- a/cmake/macros.cmake +++ b/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()