Open konsumer opened 1 week ago
Essentially, I want a Findsokol.cmake
that looks something like this (with the version changed on sokol, so they match.)
This is my current sokol entry-point (sokol.c) which I'd like to eventually also inline in the cmake build:
#define SOKOL_IMPL
#if defined(_MSC_VER)
#define SOKOL_D3D11
#elif defined(__EMSCRIPTEN__)
#define SOKOL_GLES3
#elif defined(__APPLE__)
// NOTE: on macOS, sokol.c is compiled explicitly as ObjC
//#define SOKOL_GLCORE
#define SOKOL_METAL
#else
#define SOKOL_GLCORE
#endif
#include "sokol_gfx.h"
#include "sokol_gp.h"
#include "sokol_app.h"
#include "sokol_glue.h"
#include "sokol_log.h"
Which would make cmake usage very simple:
find_package(sokol REQUIRED)
add_executable(${PROJECT_NAME} src/main.c)
target_link_libraries(${PROJECT_NAME} sokol)
If not updating is preferred, I can actually resolve with
FetchContent_Declare(sokol
URL https://github.com/floooh/sokol/archive/refs/tags/pre-bindings-cleanup.zip
)
which is a tag from last month.
I get this error:
and a bunch of others that look like the APIs don't match.
I think it is due to a mismatch of API for latest sokol from GitHub. What commit/tag should I target?
I am trying to build everything pulling sokol & sokol_gp from GitHub zips, so I don't have to vendor them. Here is my cmake:
Here are all the missing members, if an update of sokol_gp makes more sense: