Skip to content

Commit 42f26b4

Browse files
committed
Tweak build on FreeBSD
* add configuration for bsd (FreeBSD) * libdl is not required on FreeBSD * it's better to detect lua with pkgconfig (probably also true for linux) * linking with threads is correctly done with -pthread
1 parent 8feb65f commit 42f26b4

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

premake4.lua

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ solution "Dagon"
9393

9494
-- Libraries required for Unix-based systems
9595
libs_unix = { "freetype", "GLEW", "GL", "GLU", "ogg", "openal", "vorbis",
96-
"vorbisfile", "theoradec", "SDL2", "dl", "pthread" }
96+
"vorbisfile", "theoradec", "SDL2" }
9797

9898
-- Search for libraries on Linux systems
9999
if os.get() == "linux" then
@@ -125,7 +125,18 @@ solution "Dagon"
125125
"/usr/local/include/lua5.1",
126126
"/usr/local/include/freetype2" }
127127
libdirs { "/usr/lib", "/usr/local/lib" }
128+
links { libs_unix, "dl" }
129+
linkoptions { "-pthread" }
130+
131+
configuration "bsd"
132+
includedirs { "/usr/include",
133+
"/usr/local/include/freetype2",
134+
"/usr/local/include" }
135+
libdirs { "/usr/lib", "/usr/local/lib" }
136+
buildoptions { "`pkg-config --cflags lua-5.1`" }
137+
linkoptions { "`pkg-config --libs lua-5.1`" }
128138
links { libs_unix }
139+
linkoptions { "-pthread" }
129140

130141
configuration "macosx"
131142
includedirs { "/usr/include", "/usr/include/lua5.1",

0 commit comments

Comments
 (0)