From ead887f59b6c5f00d6f6e13c2fa76763bc2d14d3 Mon Sep 17 00:00:00 2001 From: Sandy Carter Date: Sun, 30 Jan 2022 18:32:56 -0500 Subject: [PATCH] bx: Link with android log library --- cmake/bx.cmake | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/cmake/bx.cmake b/cmake/bx.cmake index d8dc1de..bf79e68 100644 --- a/cmake/bx.cmake +++ b/cmake/bx.cmake @@ -70,17 +70,22 @@ target_compile_definitions( bx PUBLIC "__STDC_CONSTANT_MACROS" ) target_compile_definitions(bx PUBLIC "BX_CONFIG_DEBUG=$") # Additional dependencies on Unix -if( UNIX AND NOT APPLE AND NOT ANDROID ) +if (ANDROID) + # For __android_log_write + find_library( LOG_LIBRARY log ) + mark_as_advanced( LOG_LIBRARY ) + target_link_libraries( bx PUBLIC ${LOG_LIBRARY} ) +elseif( APPLE ) + find_library( FOUNDATION_LIBRARY Foundation) + mark_as_advanced( FOUNDATION_LIBRARY ) + target_link_libraries( bx PUBLIC ${FOUNDATION_LIBRARY} ) +elseif( UNIX ) # Threads find_package( Threads ) target_link_libraries( bx ${CMAKE_THREAD_LIBS_INIT} dl ) # Real time (for clock_gettime) target_link_libraries( bx rt ) -elseif(APPLE) - find_library( FOUNDATION_LIBRARY Foundation) - mark_as_advanced( FOUNDATION_LIBRARY ) - target_link_libraries( bx PUBLIC ${FOUNDATION_LIBRARY} ) endif() # Put in a "bgfx" folder in Visual Studio