From dc686e79f87c38505e63f7623cd795dd013f696f Mon Sep 17 00:00:00 2001 From: Raisin Ten Date: Fri, 23 Feb 2024 13:17:22 +0530 Subject: [PATCH] Use correct Homebrew Cellar on arm64 macOS Refs: https://github.com/crossnx/includejs/pull/41#discussion_r1499231236 Signed-off-by: Raisin Ten --- cmake/FindV8.cmake | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cmake/FindV8.cmake b/cmake/FindV8.cmake index 302353b9..eb6cb15f 100644 --- a/cmake/FindV8.cmake +++ b/cmake/FindV8.cmake @@ -6,10 +6,15 @@ if(NOT V8_FOUND) # downloaded from Homebrew. # Refs: https://github.com/Homebrew/homebrew-core/issues/45061#issuecomment-541420664 set(V8_VERSION "12.1.285.24") + if(CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64") + set(HOMEBREW_CELLAR "/opt/homebrew/Cellar") + elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") + set(HOMEBREW_CELLAR "/usr/local/Cellar") + endif() target_include_directories(v8 - INTERFACE "/usr/local/Cellar/v8/${V8_VERSION}/include") + INTERFACE "${HOMEBREW_CELLAR}/v8/${V8_VERSION}/include") target_link_directories(v8 - INTERFACE "/usr/local/Cellar/v8/${V8_VERSION}/lib") + INTERFACE "${HOMEBREW_CELLAR}/v8/${V8_VERSION}/lib") target_link_libraries(v8 INTERFACE "-lv8") target_link_libraries(v8 INTERFACE "-lv8_libplatform") target_compile_definitions(v8