From 6bf1d263ab145bd976adfc7dbcbc74b3ceeb73f9 Mon Sep 17 00:00:00 2001 From: momo5502 Date: Tue, 21 Feb 2017 20:03:52 +0100 Subject: [PATCH] [Premake] Add udis scripts --- premake/udis86.lua | 45 +++++++++++++++++++++++++++++++++++++++++++++ premake5.lua | 7 +++++++ 2 files changed, 52 insertions(+) create mode 100644 premake/udis86.lua diff --git a/premake/udis86.lua b/premake/udis86.lua new file mode 100644 index 00000000..c9732b42 --- /dev/null +++ b/premake/udis86.lua @@ -0,0 +1,45 @@ +udis86 = { + settings = nil +} + +function udis86.setup(settings) + if not settings.source then error("Missing source.") end + + udis86.settings = settings + + if not udis86.settings.defines then udis86.settings.defines = {} end +end + +function udis86.import() + if not udis86.settings then error("You need to call udis86.setup first") end + + links { "udis86" } + udis86.includes() +end + +function udis86.includes() + if not udis86.settings then error("You need to call udis86.setup first") end + + includedirs { udis86.settings.source } + defines(udis86.settings.defines) +end + +function udis86.project() + if not udis86.settings then error("You need to call udis86.setup first") end + + project "udis86" + language "C" + + udis86.includes() + files + { + path.join(udis86.settings.source, "libudis86/*.h"), + path.join(udis86.settings.source, "libudis86/*.c"), + } + + -- not our code, ignore POSIX usage warnings for now + warnings "Off" + + kind "SharedLib" + kind "StaticLib" +end \ No newline at end of file diff --git a/premake5.lua b/premake5.lua index d7de2557..994b786b 100644 --- a/premake5.lua +++ b/premake5.lua @@ -200,6 +200,7 @@ require "premake/protobuf" require "premake/sqlite3" require "premake/zlib" require "premake/WinToast" +require "premake/udis86" base128.setup { @@ -260,6 +261,10 @@ WinToast.setup { source = path.join(depsBasePath, "WinToast"), } +udis86.setup +{ + source = path.join(depsBasePath, "udis86"), +} workspace "iw4x" location "./build" @@ -367,6 +372,7 @@ workspace "iw4x" protobuf.import() zlib.import() WinToast.import() + udis86.import() -- fix vpaths for protobuf sources vpaths @@ -486,6 +492,7 @@ workspace "iw4x" protobuf.project() zlib.project() WinToast.project() + udis86.project() rule "ProtobufCompiler" display "Protobuf compiler"