Refactored flags handling (add-pkg).

This commit is contained in:
Jorge Acereda 2019-06-14 10:46:15 +02:00
parent 9ef01c67c6
commit 7ed48b733b
7 changed files with 14 additions and 12 deletions

View File

@ -26,3 +26,11 @@
(defndynamic add-lib [lib]
(Project.config "libflag" lib))
(defndynamic pkg-config [pkg flags]
(Dynamic.String.join ["`pkg-config " pkg " " flags "`"]))
(defndynamic add-pkg [pkg]
(do
(add-cflag (pkg-config pkg "--cflags --static"))
(add-lib (pkg-config pkg "--libs --static"))))

View File

@ -1,6 +1,5 @@
(system-include "GLFW/glfw3.h")
(add-cflag "`pkg-config glfw3 --cflags --static`")
(add-lib "`pkg-config glfw3 --libs --static`")
(add-pkg "glfw3")
(defmodule GLFW
(register init (λ [] Int) "glfwInit")

View File

@ -3,8 +3,7 @@
(local-include "../core/SDLHelper.h")
(not-on-windows
(add-cflag "`pkg-config SDL2 --cflags --static`")
(add-lib "`pkg-config SDL2 --libs --static`"))
(add-pkg "SDL2"))
(defmodule SDL
(defmodule Windows

View File

@ -1,6 +1,5 @@
(system-include "SDL2/SDL2_gfxPrimitives.h")
(add-cflag "`pkg-config SDL2_gfx --cflags --static`")
(add-lib "`pkg-config SDL2_gfx --libs --static`")
(add-pkg "SDL2_gfx")
(defmodule GFX
(doc thick-line-rgba "Draw a line from x1, y1 to x2, y2 with the width `width` and color r, g, b, a.")

View File

@ -1,7 +1,6 @@
(not-on-windows
(system-include "SDL2/SDL_image.h")
(add-cflag "`pkg-config SDL2_image --cflags --static`")
(add-lib "`pkg-config SDL2_image --libs --static`"))
(add-pkg "SDL2_image"))
(defmodule IMG
(defmodule Windows

View File

@ -1,6 +1,5 @@
(system-include "SDL2/SDL_mixer.h")
(add-cflag "`pkg-config SDL2_mixer --cflags --static`")
(add-lib "`pkg-config SDL2_mixer --libs --static`")
(add-pkg "SDL2_mixer")
(Project.config "cflag" "-Wno-incompatible-pointer-types-discards-qualifiers")
(register-type Mix_Chunk)

View File

@ -1,6 +1,5 @@
(system-include "SDL2/SDL_ttf.h")
(add-cflag "`pkg-config SDL2_ttf --cflags --static`")
(add-lib "`pkg-config SDL2_ttf --libs --static`")
(add-pkg "SDL2_ttf")
(Project.config "cflag" "-Wno-incompatible-pointer-types-discards-qualifiers")
(register-type TTF_Font)