Skip to content

Commit

Permalink
Avoid hard coded icu4c path (#11410)
Browse files Browse the repository at this point in the history
Summary: Pull Request resolved: #11410

Reviewed By: xiaoxmeng, kgpai

Differential Revision: D65354548

Pulled By: tanjialiang

fbshipit-source-id: bd6d4880198bee7162adf84b9e0ee8f8b1dd605d
  • Loading branch information
tanjialiang authored and facebook-github-bot committed Nov 1, 2024
1 parent 8bb3bb9 commit 6c7bcd7
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,18 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
if(ON_APPLE_M1)
list(APPEND CMAKE_PREFIX_PATH "/opt/homebrew/opt/icu4c")
execute_process(
COMMAND brew --prefix icu4c
RESULT_VARIABLE BREW_ICU4C
OUTPUT_VARIABLE BREW_ICU4C_PREFIX
OUTPUT_STRIP_TRAILING_WHITESPACE)
if(BREW_ICU4C EQUAL 0 AND EXISTS "${BREW_ICU4C_PREFIX}")
message(
STATUS "Found icu4c installed by Homebrew at ${BREW_ICU4C_PREFIX}")
list(APPEND CMAKE_PREFIX_PATH "${BREW_ICU4C_PREFIX}")
else()
list(APPEND CMAKE_PREFIX_PATH "/usr/local/opt/icu4c")
endif()
else()
list(APPEND CMAKE_PREFIX_PATH "/usr/local/opt/icu4c")
endif()
Expand Down

0 comments on commit 6c7bcd7

Please sign in to comment.