diff --git a/cmake/bgfx.cmake b/cmake/bgfx.cmake index 3635bde..5c284c3 100755 --- a/cmake/bgfx.cmake +++ b/cmake/bgfx.cmake @@ -51,7 +51,7 @@ if( APPLE ) target_link_libraries( bgfx PUBLIC ${COCOA_LIBRARY} ${METAL_LIBRARY} ${QUARTZCORE_LIBRARY} ) endif() -if( UNIX ) +if( UNIX AND NOT APPLE ) target_link_libraries( bgfx PUBLIC GL ) endif() @@ -69,7 +69,7 @@ if( NOT APPLE ) endif() # Exclude glx context on non-unix -if( NOT UNIX ) +if( NOT UNIX OR APPLE ) set_source_files_properties( ${BGFX_DIR}/src/glcontext_glx.cpp PROPERTIES HEADER_FILE_ONLY ON ) endif() diff --git a/cmake/bx.cmake b/cmake/bx.cmake index d2eb42d..b5204b6 100644 --- a/cmake/bx.cmake +++ b/cmake/bx.cmake @@ -39,7 +39,7 @@ elseif( APPLE ) endif() # Threads -if( UNIX ) +if( UNIX AND NOT APPLE ) find_package( Threads ) target_link_libraries( bx ${CMAKE_THREAD_LIBS_INIT} dl ) endif() diff --git a/cmake/examples.cmake b/cmake/examples.cmake index 3ff72c7..8816658 100755 --- a/cmake/examples.cmake +++ b/cmake/examples.cmake @@ -106,7 +106,7 @@ function( add_example ARG_NAME ) target_compile_definitions( example-${ARG_NAME} PRIVATE "-D_CRT_SECURE_NO_WARNINGS" "-D__STDC_FORMAT_MACROS" ) target_include_directories( example-${ARG_NAME} PUBLIC ${BGFX_DIR}/examples/common ) target_link_libraries( example-${ARG_NAME} PUBLIC bgfx ib-compress ocornut-imgui ) - if( UNIX ) + if( UNIX AND NOT APPLE ) target_link_libraries( example-${ARG_NAME} PUBLIC X11 ) endif() else()