sokol on linux

This commit is contained in:
Vadim Grigoruk 2018-09-21 18:24:59 +03:00
parent e01daea353
commit f414a864e1
2 changed files with 18 additions and 1 deletions

View File

@ -234,7 +234,16 @@ set(SOKOL_SRC
if(APPLE)
add_definitions(-DSOKOL_METAL)
elseif(WIN32)
add_definitions(-DSOKOL_D3D11)
elseif(LINUX)
add_definitions(-DSOKOL_GLCORE33)
endif()
if(APPLE)
set(SOKOL_SRC ${SOKOL_SRC} ${EXAMPLE_DIR}/sokol/sokol.m)
else()
set(SOKOL_SRC ${SOKOL_SRC} ${EXAMPLE_DIR}/sokol/sokol.c)
endif()
add_executable(sokol ${SOKOL_SRC})
@ -250,6 +259,8 @@ if(APPLE)
"-framework MetalKit"
"-framework AudioToolbox"
)
elseif(LINUX)
target_link_libraries(sokol X11 GL m dl asound)
endif()
target_include_directories(sokol PRIVATE include)
@ -501,4 +512,4 @@ foreach(TIC80_OUTPUT ${TIC80_OUTPUTS})
target_link_libraries(${TIC80_OUTPUT} ${GTK_LIBRARIES})
endif()
endforeach()
endforeach()

6
examples/sokol/sokol.c Normal file
View File

@ -0,0 +1,6 @@
#define SOKOL_IMPL
#include "sokol_app.h"
#include "sokol_gfx.h"
#include "sokol_time.h"
#include "sokol_audio.h"