Skip to content

Commit 4a3cd18

Browse files
committed
Add dependent macOS libraries for hwloc build
1 parent e39e455 commit 4a3cd18

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/CMakeLists.txt

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (C) 2023-2024 Intel Corporation
1+
# Copyright (C) 2023-2025 Intel Corporation
22
# Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT.
33
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
44

@@ -182,6 +182,18 @@ add_dependencies(umf coarse)
182182

183183
if(UMF_LINK_HWLOC_STATICALLY)
184184
add_dependencies(umf ${UMF_HWLOC_NAME})
185+
# On Darwin, link with the IOKit and Foundation frameworks, if they are
186+
# available in the system. This is to comply with hwloc which links these,
187+
# if available. There is no option to disable these frameworks on Darwin
188+
# hwloc builds.
189+
if(MACOSX)
190+
find_library(IOKIT_LIBRARY IOKit)
191+
find_library(FOUNDATION_LIBRARY Foundation)
192+
if(IOKIT_LIBRARY OR FOUNDATION_LIBRARY)
193+
target_link_libraries(umf PRIVATE ${IOKIT_LIBRARY}
194+
${FOUNDATION_LIBRARY})
195+
endif()
196+
endif()
185197
endif()
186198

187199
if(NOT WINDOWS AND UMF_POOL_JEMALLOC_ENABLED)

0 commit comments

Comments
 (0)