Skip to content

Commit

Permalink
sokol: fix v -cc gcc ~/.vmodules/sdl/examples/sdl_opengl_and_sokol/
Browse files Browse the repository at this point in the history
… on Linux (add missing -lm for gcc/clang)
  • Loading branch information
spytheman committed Jul 27, 2023
1 parent 76e3b7d commit aa3d560
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions vlib/sokol/c/declaration.c.v
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,21 @@ pub const used_import = 1
#flag -I @VEXEROOT/thirdparty/sokol/util
#flag freebsd -I /usr/local/include
#flag darwin -fobjc-arc

#flag linux -lX11 -lGL -lXcursor -lXi -lpthread
#flag freebsd -L/usr/local/lib -lX11 -lGL -lXcursor -lXi
#flag openbsd -L/usr/X11R6/lib -lX11 -lGL -lXcursor -lXi
#flag windows -lgdi32

// Note that -lm is needed *only* for sokol_gl.h's usage of sqrtf(),
// but without -lm, this fails:
// `v -cc gcc ~/.vmodules/sdl/examples/sdl_opengl_and_sokol/`
// With tcc, this succeeds with or without -lm:
// `v ~/.vmodules/sdl/examples/sdl_opengl_and_sokol/`
$if !tinyc {
#flag linux -lm
}

// METAL
$if macos {
$if darwin_sokol_glcore33 ? {
Expand Down

0 comments on commit aa3d560

Please sign in to comment.