From fc9a6f8ff611c38967d33580cfe3eb11b8d52b48 Mon Sep 17 00:00:00 2001 From: PastaPastaPasta <6443210+PastaPastaPasta@users.noreply.github.com> Date: Mon, 9 May 2022 06:13:49 -0500 Subject: [PATCH] build: enhance CMakeLists to dynamically detect kernel version to utilize (#4828) --- CMakeLists.txt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3da1919857..e0dadffebe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,10 +21,16 @@ if(UNIX AND NOT APPLE) set(DEPENDS_PREFIX depends/x86_64-pc-linux-gnu) elseif(APPLE) EXECUTE_PROCESS( COMMAND uname -m COMMAND tr -d '\n' OUTPUT_VARIABLE ARCHITECTURE ) + EXECUTE_PROCESS( COMMAND system_profiler -detailLevel mini -json SPSoftwareDataType + COMMAND jq .SPSoftwareDataType + COMMAND jq .[] + COMMAND jq .kernel_version + COMMAND tr -d "Dawrin\" " + OUTPUT_VARIABLE DARWIN_KERNEL_VERSION) if( ${ARCHITECTURE} STREQUAL "arm64" ) - set(DEPENDS_PREFIX depends/aarch64-apple-darwin21.2.0) + set(DEPENDS_PREFIX depends/aarch64-apple-darwin${DARWIN_KERNEL_VERSION}) else() - set(DEPENDS_PREFIX depends/x86_64-apple-darwin19) + set(DEPENDS_PREFIX depends/x86_64-apple-darwin${DARWIN_KERNEL_VERSION}) endif() elseif(WIN32) set(DEPENDS_PREFIX depends/x86_64-w64-mingw32)