Ticket #63726: patch-package_name.cmake.2.diff

File patch-package_name.cmake.2.diff, 937 bytes (added by chrstphrchvz (Christopher Chavez), 2 years ago)

Patch for upstream fix

  • cmake/package_name.cmake

    The "Could not run sw_vers" error is output when building on macOS x.y.z
    when y is 0 (example: macOS 12.0.1) because CMAKE_MATCH_2 is set to "0",
    which when used as a condition evaluates to false.
    Use DEFINED instead to know whether CMAKE_MATCH_1 and CMAKE_MATCH_2
    are properly set.
    https://bugs.mysql.com/bug.php?id=105464#c517341
    ---
     cmake/package_name.cmake | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/cmake/package_name.cmake b/cmake/package_name.cmake
    index 058b0bcbd8cb..7983475221c 100644
    a b MACRO(GET_PACKAGE_FILE_NAME Var) 
    8888
    8989      STRING(REGEX MATCH
    9090        "ProductVersion:[\n\t ]*([0-9]+)\\.([0-9]+)" UNUSED ${SW_VERS_PRODUCTVERSION})
    91       IF(NOT CMAKE_MATCH_1 OR NOT CMAKE_MATCH_2)
     91      IF(NOT DEFINED CMAKE_MATCH_1 OR NOT DEFINED CMAKE_MATCH_2)
    9292        MESSAGE(FATAL_ERROR "Could not run sw_vers")
    9393      ENDIF()
    9494