- elif host_machine.system() == 'windows'
- decklink_sources += ['win/DeckLinkAPIDispatch.cpp', 'win/DeckLinkAPI_i.c']
- build_decklink = true
- else
- message('Not building decklink plugin for system ' + host_machine.system())
+ decklink_libs = [comutil_dep]
+ endif
+else
+ libdl = cc.find_library('dl', required: false)
+ have_pthread_h = cdata.has('HAVE_PTHREAD_H')
+ if libdl.found() and have_pthread_h
+ decklink_libs = [libm, libdl, dependency('threads')]
+ if host_machine.system() == 'linux'
+ decklink_sources += ['linux/DeckLinkAPIDispatch.cpp']
+ build_decklink = true
+ elif host_machine.system() == 'darwin'
+ decklink_sources += ['osx/DeckLinkAPIDispatch.cpp']
+ decklink_ldflags = ['-Wl,-framework,CoreFoundation']
+ build_decklink = true
+ endif