From 109ad1fc083ead40e278d14f2873ac53dc690dfd Mon Sep 17 00:00:00 2001 From: nekobit Date: Mon, 3 Apr 2023 16:56:16 +0000 Subject: [PATCH] Switch to premake5, as we need custom rules for .ctt generation FossilOrigin-Name: 53c0a5d0fd0c60024ae08322a97e790752a714e7576e26eb56b83afcf48cc392 --- premake4.lua => premake5.lua | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) rename premake4.lua => premake5.lua (79%) diff --git a/premake4.lua b/premake5.lua similarity index 79% rename from premake4.lua rename to premake5.lua index 8989555..281c069 100644 --- a/premake4.lua +++ b/premake5.lua @@ -1,12 +1,10 @@ -premake.gcc.cc = os.getenv("CC") or 'cc'; - if not os.isfile('config.h') then print("Note: `config.h' not found, until a new Treebird release comes out,"); print(" please copy `config.def.h' and edit it."); os.exit(1); end -solution "Treebird"; +workspace "Treebird"; configurations { "Debug", "Release" }; local c_files = { @@ -59,14 +57,14 @@ local pages = { local definitions = {}; -- Create definitions for page enabling -for i=1, table.getn(pages) do +for i=1, #pages do local def = 'CMP_ENABLE_' .. string.upper(string.sub(pages[i], 0, -3)); table.insert(definitions, def); end -- Prepend with 'src/' -for i=1, table.getn(c_files) do c_files[i] = 'src/'.. c_files[i] end -for i=1, table.getn(pages) do pages[i] = 'src/'.. pages[i] end +for i=1, #c_files do c_files[i] = 'src/'.. c_files[i] end +for i=1, #pages do pages[i] = 'src/'.. pages[i] end -- BEGIN Mastodont project project("treebird"); @@ -87,22 +85,21 @@ if not libfcgi then os.exit(1); end -configuration { "gmake" }; -linkoptions{ "`pkg-config --libs mastodont` `perl -MExtUtils::Embed -e ldopts`" }; -buildoptions{ "`pkg-config --cflags mastodont` `perl -MExtUtils::Embed -e ccopts`" }; -links{"fcgi"}; +filter { "action:gmake*" }; + linkoptions{ "`pkg-config --libs mastodont` `perl -MExtUtils::Embed -e ldopts`" }; + buildoptions{ "`pkg-config --cflags mastodont` `perl -MExtUtils::Embed -e ccopts`" }; + links{"fcgi"}; -if premake.gcc.cc ~= 'clang' then +filter { "toolset:clang" }; buildoptions{"-Wno-compound-token-split-by-macro"}; -end -configuration { "Debug" }; +filter { "configurations:Debug" }; defines { "DEBUG" }; -flags("Symbols"); +symbols("On"); -configuration { "Release" }; +filter { "configurations:Release" }; defines { "NDEBUG" }; -flags("Optimize"); +optimize("On"); -- END Mastodont-c local prefix = os.getenv("PREFIX") or "/usr/local";