From 12d920a0e4f99f693284e7135709f4179bd0e8c5 Mon Sep 17 00:00:00 2001 From: Stephen Kennedy Date: Sun, 10 May 2015 22:45:56 +0100 Subject: [PATCH 1/2] Added premake script for project file generation See http://premake.github.io/ for more info about premake --- premake5.lua | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 premake5.lua diff --git a/premake5.lua b/premake5.lua new file mode 100644 index 000000000..0711cde41 --- /dev/null +++ b/premake5.lua @@ -0,0 +1,44 @@ +-- premake5.lua + +solution "PEGTL" + location "build" + includedirs { "." } + kind "ConsoleApp" + language "C++" + defines { "_CRT_SECURE_NO_WARNINGS" } + flags { "MultiProcessorCompile" } + configurations { "Debug", "Release" } + filter "configurations:Debug" + defines { "DEBUG" } + flags { "Symbols" } + filter "configurations:Release" + defines { "NDEBUG" } + optimize "On" + +project "pegtl" + files { "pegtl/**.hh" } + +group "Test" +project "UnitTest" + files { "unit_tests/**.hh", "unit_tests/**.cc" } + pchheader "test.hh" + pchsource "unit_tests/trace.cc" + +examples = { + "calculator", + "hello_world", + "json_build_one", + "json_build_two", + "json_parse", + "lua53_parse", + "modulus_match", + "s_expression", + "sum", + "unescape", + "uri_trace" + } +group ("Examples") +for _,proj in next,examples,nil do + project (proj) + files { "examples/" .. proj .. ".cc" } +end From 368d65b43ce207386c787f2458495448b3231635 Mon Sep 17 00:00:00 2001 From: Stephen Kennedy Date: Sun, 17 May 2015 22:29:39 +0100 Subject: [PATCH 2/2] Updated premake script --- premake5.lua | 51 +++++++++++++++++++++++++++++---------------------- 1 file changed, 29 insertions(+), 22 deletions(-) diff --git a/premake5.lua b/premake5.lua index 0711cde41..6d57ebeff 100644 --- a/premake5.lua +++ b/premake5.lua @@ -16,29 +16,36 @@ solution "PEGTL" optimize "On" project "pegtl" + kind "None" files { "pegtl/**.hh" } -group "Test" -project "UnitTest" - files { "unit_tests/**.hh", "unit_tests/**.cc" } - pchheader "test.hh" - pchsource "unit_tests/trace.cc" +group "UnitTest" + for _,proj in next,os.matchfiles("unit_tests/*.cc"),nil do + for name in string.gmatch(proj, "/([%a%d_]+)\.") do + project(name) + files { proj } + end + end + + project "include" + kind "None" + files { "unit_tests/**.hh" } -examples = { - "calculator", - "hello_world", - "json_build_one", - "json_build_two", - "json_parse", - "lua53_parse", - "modulus_match", - "s_expression", - "sum", - "unescape", - "uri_trace" - } group ("Examples") -for _,proj in next,examples,nil do - project (proj) - files { "examples/" .. proj .. ".cc" } -end + examples = { + "calculator", + "hello_world", + "json_build_one", + "json_build_two", + "json_parse", + "lua53_parse", + "modulus_match", + "s_expression", + "sum", + "unescape", + "uri_trace" + } + for _,proj in next,examples,nil do + project (proj) + files { "examples/" .. proj .. ".cc" } + end