sdl3-bindgen-sys
Safe HaskellNone
LanguageGHC2021

SDL3.Sys.Bindgen.Dlopennote

Description

This header allows you to annotate your code so external tools know about dynamic shared library dependencies.

If you determine that your toolchain doesn't support dlopen notes, you can disable this feature by defining SDL_DISABLE_DLOPEN_NOTES. You can use this CMake snippet to check for support:

Use this macro with SDL_ELF_NOTE_DLOPEN() to note that a dynamic shared library dependency is optional.

    include(CheckCSourceCompiles)
    find_package(SDL3 REQUIRED CONFIG COMPONENTS Headers)
    list(APPEND CMAKE_REQUIRED_LIBRARIES SDL3::Headers)
    check_c_source_compiles([==[
      #include <SDL3/SDL_dlopennote.h>
      SDL_ELF_NOTE_DLOPEN("sdl-video",
        "Support for video through SDL",
        SDL_ELF_NOTE_DLOPEN_PRIORITY_SUGGESTED,
        "libSDL-1.2.so.0", "libSDL-2.0.so.0", "libSDL3.so.0"
      )
      int main(int argc, char *argv[]) {
        return argc + argv[0][1];
      }
    ]==] COMPILER_SUPPORTS_SDL_ELF_NOTE_DLOPEN)
    if(NOT COMPILER_SUPPORTS_SDL_ELF_NOTE_DLOPEN)
      add_compile_definitions(-DSDL_DISABLE_DLOPEN_NOTE)
    endif()
    

Optional functionality uses the dependency, the binary will work and the dependency is only needed for full-featured installations.

See also
SDL_ELF_NOTE_DLOPEN, sDL_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED, sDL_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED

Since: 3.4.0

Synopsis

Documentation

sDL_ELF_NOTE_DLOPEN_PRIORITY_SUGGESTED :: ByteString Source #

C declaration
macro SDL_ELF_NOTE_DLOPEN_PRIORITY_SUGGESTED, literal "suggested", defined at SDL3/SDL_dlopennote.h 71:9

sDL_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED :: ByteString Source #

Use this macro with SDL_ELF_NOTE_DLOPEN() to note that a dynamic shared library dependency is recommended.

Important functionality needs the dependency, the binary will work but in most cases the dependency should be provided.

See also
SDL_ELF_NOTE_DLOPEN, sDL_ELF_NOTE_DLOPEN_PRIORITY_SUGGESTED, sDL_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED
C declaration
macro SDL_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED, literal "recommended", defined at SDL3/SDL_dlopennote.h 86:9

Since: 3.4.0

sDL_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED :: ByteString Source #

Use this macro with SDL_ELF_NOTE_DLOPEN() to note that a dynamic shared library dependency is required.

Core functionality needs the dependency, the binary will not work if it cannot be found.

See also
SDL_ELF_NOTE_DLOPEN, sDL_ELF_NOTE_DLOPEN_PRIORITY_SUGGESTED, sDL_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED
C declaration
macro SDL_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED, literal "required", defined at SDL3/SDL_dlopennote.h 101:9

Since: 3.4.0