Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmake: link missing framework CoreFoundation and IOKit for machine_id on macOS. #8157

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,22 @@ if(FLB_BINARY)
DESTINATION ${FLB_INSTALL_CONFDIR}
COMPONENT binary
RENAME "${FLB_OUT_NAME}.conf")

# link in CoreFoundation and IOKit for machine_id code on macOS
find_library(CORE_FOUNDATION CoreFoundation)
if (NOT CORE_FOUNDATION)
message(FATAL_ERROR "CoreFoundation framework missing on macOS")
endif()

find_library(IOKITLIB IOKit)
if (NOT IOKITLIB)
message(FATAL_ERROR "IOKitLib framework missing on macOS")
endif()

target_link_libraries(fluent-bit-static "-framework CoreFoundation")
target_link_libraries(fluent-bit-static "-framework IOKit")
set_target_properties(fluent-bit-static PROPERTIES LINK_FLAGS "-Wl,-F/Library/Frameworks")

else()
install(FILES
"${PROJECT_SOURCE_DIR}/conf/fluent-bit.conf"
Expand Down
Loading