From 71c11c5d6f67d9b5f3660e93503def8b44e62780 Mon Sep 17 00:00:00 2001 From: Lynix Date: Wed, 27 May 2020 16:58:21 +0200 Subject: [PATCH] Add PlatformSDL2_Path config --- build/config.lua | 3 ++- build/scripts/modules/platform.lua | 11 +++++++++++ build/scripts/modules/renderer.lua | 11 +++++++++++ examples/HardwareInfo/build.lua | 5 ++++- 4 files changed, 28 insertions(+), 2 deletions(-) diff --git a/build/config.lua b/build/config.lua index fa14d9a90..6589eb3b7 100644 --- a/build/config.lua +++ b/build/config.lua @@ -26,4 +26,5 @@ ServerMode = false UniteModules = false -- Use SDL2 platform -PlatformSDL2 = true \ No newline at end of file +PlatformSDL2 = true +PlatformSDL2_Path = "../../SDL2" \ No newline at end of file diff --git a/build/scripts/modules/platform.lua b/build/scripts/modules/platform.lua index d6201c526..2f5cfb1be 100644 --- a/build/scripts/modules/platform.lua +++ b/build/scripts/modules/platform.lua @@ -15,6 +15,17 @@ if (Config.PlatformSDL2) then table.insert(MODULE.Libraries, "SDL2") + assert(Config.PlatformSDL2_Path) + MODULE.Includes = Config.PlatformSDL2_Path .. "/include" + MODULE.LibraryPaths.x64 = { + Config.PlatformSDL2_Path .. "/lib/x64/", + Config.PlatformSDL2_Path .. "/bin/x64/" + } + MODULE.LibraryPaths.x86 = { + Config.PlatformSDL2_Path .. "/lib/x86/", + Config.PlatformSDL2_Path .. "/bin/x86/" + } + MODULE.FilesExcluded = { "../src/Nazara/Platform/Win32/**", "../src/Nazara/Platform/X11/**" diff --git a/build/scripts/modules/renderer.lua b/build/scripts/modules/renderer.lua index c9f65526f..b28a268ad 100644 --- a/build/scripts/modules/renderer.lua +++ b/build/scripts/modules/renderer.lua @@ -20,6 +20,17 @@ if (Config.PlatformSDL2) then table.insert(MODULE.Libraries, "SDL2") + assert(Config.PlatformSDL2_Path) + MODULE.Includes = Config.PlatformSDL2_Path .. "/include" + MODULE.LibraryPaths.x64 = { + Config.PlatformSDL2_Path .. "/lib/x64/", + Config.PlatformSDL2_Path .. "/bin/x64/" + } + MODULE.LibraryPaths.x86 = { + Config.PlatformSDL2_Path .. "/lib/x86/", + Config.PlatformSDL2_Path .. "/bin/x86/" + } + MODULE.FilesExcluded = { "../src/Nazara/Renderer/Win32/**", "../src/Nazara/Renderer/GLX/**.cpp" diff --git a/examples/HardwareInfo/build.lua b/examples/HardwareInfo/build.lua index c0917e765..6f49557d7 100644 --- a/examples/HardwareInfo/build.lua +++ b/examples/HardwareInfo/build.lua @@ -17,6 +17,9 @@ EXAMPLE.Libraries = { "NazaraUtility" } -if Config.PlatformSDL2 then +if (Config.PlatformSDL2) then table.insert(EXAMPLE.Defines, "NAZARA_PLATFORM_SDL2") + + assert(Config.PlatformSDL2_Path) + EXAMPLE.Includes = Config.PlatformSDL2_Path .. "/include" end