From f81d8ee1462333c61f09c3fa32c3a4dc055c09fd Mon Sep 17 00:00:00 2001 From: e-erdal Date: Mon, 31 Jan 2022 19:16:08 +0300 Subject: [PATCH 1/2] Add IOKit for Metal backend --- cmake/bgfx.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmake/bgfx.cmake b/cmake/bgfx.cmake index 47e6faa..dedcc75 100755 --- a/cmake/bgfx.cmake +++ b/cmake/bgfx.cmake @@ -92,7 +92,8 @@ target_link_libraries( bgfx PRIVATE bx bimg ) # Frameworks required on iOS, tvOS and macOS if( ${CMAKE_SYSTEM_NAME} MATCHES iOS|tvOS ) - target_link_libraries (bgfx PUBLIC "-framework OpenGLES -framework Metal -framework UIKit -framework CoreGraphics -framework QuartzCore") + target_link_libraries (bgfx PUBLIC + "-framework OpenGLES -framework Metal -framework UIKit -framework CoreGraphics -framework QuartzCore -framework IOKit") elseif( APPLE ) find_library( COCOA_LIBRARY Cocoa ) find_library( METAL_LIBRARY Metal ) From 9f3943b829a8d429f05971fe90a87a2d7e36e70f Mon Sep 17 00:00:00 2001 From: e-erdal Date: Mon, 31 Jan 2022 19:38:44 +0300 Subject: [PATCH 2/2] Link IOKit + CoreFoundation --- cmake/bgfx.cmake | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cmake/bgfx.cmake b/cmake/bgfx.cmake index dedcc75..f75c460 100755 --- a/cmake/bgfx.cmake +++ b/cmake/bgfx.cmake @@ -93,15 +93,19 @@ target_link_libraries( bgfx PRIVATE bx bimg ) # Frameworks required on iOS, tvOS and macOS if( ${CMAKE_SYSTEM_NAME} MATCHES iOS|tvOS ) target_link_libraries (bgfx PUBLIC - "-framework OpenGLES -framework Metal -framework UIKit -framework CoreGraphics -framework QuartzCore -framework IOKit") + "-framework OpenGLES -framework Metal -framework UIKit -framework CoreGraphics -framework QuartzCore -framework IOKit -framework CoreFoundation") elseif( APPLE ) find_library( COCOA_LIBRARY Cocoa ) find_library( METAL_LIBRARY Metal ) find_library( QUARTZCORE_LIBRARY QuartzCore ) + find_library( IOKIT_LIBRARY IOKit ) + find_library( COREFOUNDATION_LIBRARY CoreFoundation ) mark_as_advanced( COCOA_LIBRARY ) mark_as_advanced( METAL_LIBRARY ) mark_as_advanced( QUARTZCORE_LIBRARY ) - target_link_libraries( bgfx PUBLIC ${COCOA_LIBRARY} ${METAL_LIBRARY} ${QUARTZCORE_LIBRARY} ) + mark_as_advanced( IOKIT_LIBRARY ) + mark_as_advanced( COREFOUNDATION_LIBRARY ) + target_link_libraries( bgfx PUBLIC ${COCOA_LIBRARY} ${METAL_LIBRARY} ${QUARTZCORE_LIBRARY} ${IOKIT_LIBRARY} ${COREFOUNDATION_LIBRARY} ) endif() if( UNIX AND NOT APPLE AND NOT EMSCRIPTEN AND NOT ANDROID )