Skip to content

Commit a44ed8d

Browse files
committed
GPU: support loading dynamic libraries on macOS
qlibload.h knew about Linux and Windows only, so any dlopen-based backend loader was unbuildable on macOS. Adds the __APPLE__ branch (.dylib, dlopen). Independent of any GPU backend.
1 parent d48b3a3 commit a44ed8d

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

GPU/GPUTracking/utils/qlibload.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@
2121
#define LIBRARY_LOAD(name) LoadLibraryEx(name, nullptr, nullptr)
2222
#define LIBRARY_CLOSE FreeLibrary
2323
#define LIBRARY_FUNCTION GetProcAddress
24+
#elif defined(__APPLE__)
25+
#define LIBRARY_EXTENSION ".dylib"
26+
#define LIBRARY_TYPE void*
27+
#define LIBRARY_LOAD(name) dlopen(name, RTLD_NOW)
28+
#define LIBRARY_CLOSE dlclose
29+
#define LIBRARY_FUNCTION dlsym
2430
#else
2531
#define LIBRARY_EXTENSION ".so"
2632
#define LIBRARY_TYPE void*

0 commit comments

Comments
 (0)