Skip to content

Build stub library from dynapi? #25

@icculus

Description

@icculus

This might be a completely stupid idea (and maybe I said it before?), but I was thinking:

For projects that just want to make sure they build on GitHub Actions and don't care beyond that, we could maybe do this:

  • Grab a copy of the SDL sources.
  • Build with a file that turns SDL/src/dynapi/SDL_dynapi_procs.h into a complete library in one source file
  • Compile that one source file into a library that has all the right symbols but no actual code, install that and the public headers.
  • Project on GitHub Actions compiles against the headers and links against this stub library.

The benefit is that building SDL from scratch is (presumably) significantly faster and doesn't need any special configuration beyond access to a C compiler, and doesn't need extra tools and dependencies installed. The downside is obviously this won't actually function as a library if the project wants to run tests or whatnot, so this would have to be an option and not the default.

The source code to compile might look as simple as:

#include <SDL3/SDL.h>
#define SDL_DYNAPI_PROC(rettype,fnname,params,args,retn) \
    rettype fnname params { retn 0; }
#include "SDL_dynapi_procs.h"

...is this a terrible idea?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions