Skip to content
Snippets Groups Projects
Commit efa0e2dd authored by oyarzun's avatar oyarzun Committed by Brad King
Browse files

FindJNI: Update for Xcode greater than 12.1 on macOS

`JavaVM.framework` was removed from Xcode in version 12.2+.

Fixes: #23364
parent cbcd2978
No related branches found
No related tags found
No related merge requests found
......@@ -383,6 +383,23 @@ foreach(JAVA_PROG "${JAVA_RUNTIME}" "${JAVA_COMPILE}" "${JAVA_ARCHIVE}")
endforeach()
if(APPLE)
if(DEFINED XCODE_VERSION)
set(_FindJNI_XCODE_VERSION "${XCODE_VERSION}")
else()
# get xcode version
execute_process(
COMMAND xcodebuild -version
OUTPUT_VARIABLE _xcode_version
)
string(REGEX REPLACE "Xcode ([0-9]+(\\.[0-9]+)*)" "\\1" _FindJNI_XCODE_VERSION ${_xcode_version})
unset(_xcode_version)
endif()
if(_FindJNI_XCODE_VERSION VERSION_GREATER 12.1)
set(CMAKE_FIND_FRAMEWORK "NEVER")
endif()
unset(_FindJNI_XCODE_VERSION)
if(CMAKE_FIND_FRAMEWORK STREQUAL "ONLY")
set(_JNI_SEARCHES FRAMEWORK)
elseif(CMAKE_FIND_FRAMEWORK STREQUAL "NEVER")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment