Skip to content

Commit

Permalink
Fix ICU resolve_dependency (facebookincubator#5036)
Browse files Browse the repository at this point in the history
Summary:
fixes facebookincubator#5022

The fuzzer failures where happenning because `FindICU` apparently requires components to be specified and does not fallback on looking for all. Additionally we really only need icu for Boost (from source) so it makes no sense to always look for it.

Pull Request resolved: facebookincubator#5036

Reviewed By: xiaoxmeng

Differential Revision: D46154393

Pulled By: kgpai

fbshipit-source-id: ee14e46c85bcd0af85d2a9c6c2a49791dc05b672
  • Loading branch information
assignUser authored and facebook-github-bot committed May 25, 2023
1 parent c6227b5 commit 656ec59
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 12 deletions.
22 changes: 21 additions & 1 deletion CMake/resolve_dependency_modules/boost.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,28 @@
# See the License for the specific language governing permissions and
# limitations under the License.
include_guard(GLOBAL)
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/boost)

if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
if(ON_APPLE_M1)
list(APPEND CMAKE_PREFIX_PATH "/opt/homebrew/opt/icu4c")
else()
list(APPEND CMAKE_PREFIX_PATH "/usr/local/opt/icu4c")
endif()
endif()

# ICU is only needed with Boost build from source
set_source(ICU)
resolve_dependency(
ICU
COMPONENTS
data
i18n
io
uc
tu
test)

add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/boost)
if(${ICU_SOURCE} STREQUAL "BUNDLED")
# ensure ICU is built before Boost
add_dependencies(boost_regex ICU ICU::i18n)
Expand Down
11 changes: 0 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -308,17 +308,6 @@ message("FINAL CMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}")

set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
if(ON_APPLE_M1)
set(CMAKE_PREFIX_PATH "/opt/homebrew/opt/icu4c" ${CMAKE_PREFIX_PATH})
else()
set(CMAKE_PREFIX_PATH "/usr/local/opt/icu4c" ${CMAKE_PREFIX_PATH})
endif()
endif()

set_source(ICU)
resolve_dependency(ICU)

set(BOOST_INCLUDE_LIBRARIES
headers
atomic
Expand Down

0 comments on commit 656ec59

Please sign in to comment.