Skip to content

Commit

Permalink
Use correct Homebrew Cellar on arm64 macOS
Browse files Browse the repository at this point in the history
Refs: #41 (comment)
Signed-off-by: Raisin Ten <raisinten@gmail.com>
  • Loading branch information
Raisin Ten authored and Raisin Ten committed Feb 23, 2024
1 parent e469c9d commit dc686e7
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions cmake/FindV8.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit dc686e7

Please sign in to comment.