You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kvrocks.apache.org by "git-hulk (via GitHub)" <gi...@apache.org> on 2023/02/07 14:08:08 UTC

[GitHub] [incubator-kvrocks] git-hulk commented on a diff in pull request #1250: Automatically set the env MACOSX_DEPLOYMENT_TARGET to the current macOS version unless the env is already set

git-hulk commented on code in PR #1250:
URL: https://github.com/apache/incubator-kvrocks/pull/1250#discussion_r1098708444


##########
cmake/luajit.cmake:
##########
@@ -19,27 +19,42 @@ include_guard()
 
 include(cmake/utils.cmake)
 
-if((${CMAKE_SYSTEM_NAME} MATCHES "Darwin") AND (NOT CMAKE_OSX_DEPLOYMENT_TARGET))
+if ((${CMAKE_SYSTEM_NAME} MATCHES "Darwin") AND (NOT CMAKE_OSX_DEPLOYMENT_TARGET))
+  set(sw_cmd "sw_vers")
+  set(sw_arg "-productVersion")
+  execute_process(COMMAND ${sw_cmd} ${sw_arg}
+          WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
+          OUTPUT_VARIABLE OUTPUT
+          RESULT_VARIABLE STATUS
+          OUTPUT_STRIP_TRAILING_WHITESPACE)
+  if (STATUS EQUAL 0)
+    string(REGEX MATCH "[0-9]+.[0-9]+"
+            DEPLOYMENT_TARGET ${OUTPUT})
+    set(CMAKE_OSX_DEPLOYMENT_TARGET "${DEPLOYMENT_TARGET}")
+    message(STATUS "CMAKE_OSX_DEPLOYMENT_TARGET was set to: ${DEPLOYMENT_TARGET}")
+  endif ()

Review Comment:
   Good advice, will update



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org