Skip to content

Commit 96ff687

Browse files
committed
linux header/library premake configuration
1 parent 9d0038a commit 96ff687

File tree

1 file changed

+49
-36
lines changed

1 file changed

+49
-36
lines changed

build_scripts/premake.lua

+49-36
Original file line numberDiff line numberDiff line change
@@ -210,32 +210,42 @@ function runtime_project_configuration()
210210
includedirs { "/usr/include/bullet" }
211211
includedirs { "/usr/include/freetype2" }
212212
includedirs { "/usr/include/renderdoc" }
213+
includedirs { "../third_party/free_image" }
214+
includedirs { "../third_party/linux/include" }
213215
end
214-
215216
includedirs { "../runtime/Core" } -- This is here because clang needs the full pre-compiled header path
216217

217218
-- Libraries
218-
libdirs (LIBRARY_DIR)
219+
if os.target() == "windows" then
220+
libdirs (LIBRARY_DIR)
221+
else
222+
libdirs ("../third_party/linux/lib")
223+
end
219224

220-
-- "Release"
221-
filter "configurations:release"
222-
debugdir (TARGET_DIR)
223-
targetdir (TARGET_DIR)
225+
debugdir (TARGET_DIR)
226+
targetdir (TARGET_DIR)
227+
if os.target() == "linux" then
224228
links { "dxcompiler" }
225229
links { "assimp" }
226-
links { "FreeImageLib" }
230+
links { "FreeImage" }
227231
links { "freetype" }
228-
links { "BulletCollision", "BulletDynamics", "BulletSoftBody", "LinearMath" }
229-
links { "SDL3" }
230-
links { "Compressonator_MT" }
231-
links { "OpenImageDenoise" , "OpenImageDenoise_core", "OpenImageDenoise_utils" }
232-
links { "meshoptimizer" }
233-
links(API_LIBRARIES[ARG_API_GRAPHICS].release or {})
234-
232+
end
233+
-- "Release"
234+
filter "configurations:release"
235+
if os.target() == "windows" then
236+
links { "dxcompiler" }
237+
links { "assimp" }
238+
links { "FreeImageLib" }
239+
links { "freetype" }
240+
links { "BulletCollision", "BulletDynamics", "BulletSoftBody", "LinearMath" }
241+
links { "SDL3" }
242+
links { "Compressonator_MT" }
243+
links { "OpenImageDenoise" , "OpenImageDenoise_core", "OpenImageDenoise_utils" }
244+
links { "meshoptimizer" }
245+
links(API_LIBRARIES[ARG_API_GRAPHICS].release or {})
246+
end
235247
-- "Debug"
236248
filter "configurations:debug"
237-
debugdir (TARGET_DIR)
238-
targetdir (TARGET_DIR)
239249
if os.target() == "windows" then
240250
links { "dxcompiler" }
241251
links { "assimp_debug" }
@@ -247,15 +257,6 @@ function runtime_project_configuration()
247257
links { "OpenImageDenoise_debug" , "OpenImageDenoise_core_debug", "OpenImageDenoise_utils_debug" }
248258
links { "meshoptimizer_debug" }
249259
links(API_LIBRARIES[ARG_API_GRAPHICS].debug or {})
250-
else
251-
links { "dxcompiler" }
252-
links { "assimp" }
253-
links { "FreeImageLib" }
254-
links { "freetype" }
255-
links { "BulletCollision", "BulletDynamics", "BulletSoftBody", "LinearMath" }
256-
links { "SDL3" }
257-
links { "Compressonator_MT" }
258-
links { "OpenImageDenoise" , "OpenImageDenoise_core", "OpenImageDenoise_utils" }
259260
end
260261
end
261262

@@ -305,27 +306,39 @@ function editor_project_configuration()
305306
end
306307

307308
-- Libraries
308-
libdirs (LIBRARY_DIR)
309+
if os.target() == "windows" then
310+
libdirs (LIBRARY_DIR)
311+
else
312+
libdirs ("../third_party/linux/lib")
313+
end
314+
targetdir (TARGET_DIR)
315+
debugdir (TARGET_DIR)
309316

317+
if os.target() == "linux" then
318+
links { "FreeImage" }
319+
links { "freetype" }
320+
links { "BulletCollision", "BulletDynamics", "BulletSoftBody", "LinearMath" }
321+
links { "OpenImageDenoise"}
322+
links { "freetype" }
323+
links { "SDL3" }
324+
links { "meshoptimizer" }
325+
links { "vulkan" }
326+
links { "spirv-cross-core", "spirv-cross-c", "spirv-cross-cpp", "spirv-cross-glsl", "spirv-cross-hlsl" }
327+
links { "CMP_Compressonator", "CMP_Core", "CMP_Core_SSE", "CMP_Common", "CMP_Core_AVX", "CMP_Core_AVX512" }
328+
end
310329
-- "Release"
311330
filter "configurations:release"
312331
targetname ( EXECUTABLE_NAME )
313-
targetdir (TARGET_DIR)
314-
debugdir (TARGET_DIR)
315-
links { "freetype" }
316-
links { "SDL3" }
317-
332+
if os.target() == "windows" then
333+
links { "freetype" }
334+
links { "SDL3" }
335+
end
318336
-- "Debug"
319337
filter "configurations:debug"
320338
targetname ( EXECUTABLE_NAME .. "_debug" )
321-
targetdir (TARGET_DIR)
322-
debugdir (TARGET_DIR)
323339
if os.target() == "windows" then
324340
links { "freetype_debug" }
325341
links { "SDL3_debug" }
326-
else
327-
links { "freetype" }
328-
links { "SDL3" }
329342
end
330343
end
331344

0 commit comments

Comments
 (0)