61f9697250
FossilOrigin-Name: 5ddb64512d6317f677daa59ab5eca56610846aa8b8fa95a77bdaaca88715979b
40 lines
1.1 KiB
Lua
40 lines
1.1 KiB
Lua
solution "mastodont-c";
|
|
configurations { "Debug", "Release" };
|
|
|
|
-- BEGIN Mastodont project
|
|
project("mastodont");
|
|
kind("StaticLib");
|
|
language("C");
|
|
files { "include/*.h", "src/*.c" };
|
|
includedirs { "include/" };
|
|
|
|
configuration { "linux", "bsd", "gmake" };
|
|
linkoptions { "`curl-config --libs`" };
|
|
linkoptions { "`pkg-config --libs cjson`" };
|
|
|
|
|
|
configuration { "Debug" };
|
|
defines { "DEBUG" };
|
|
flags("Symbols");
|
|
|
|
configuration { "Release" };
|
|
defines { "NDEBUG" };
|
|
flags("Optimize");
|
|
-- END Mastodont-c
|
|
|
|
local prefix = os.getenv("PREFIX") or "/usr/local";
|
|
local pkgconfig_path = os.getenv("PKG_CONFIG_PATH") or
|
|
(os.isdir(prefix .. "/pkgconfig") and prefix .. "/pkgconfig") or
|
|
prefix .. "/share/pkgconfig";
|
|
|
|
newaction {
|
|
trigger = "install",
|
|
description = "install the library",
|
|
execute = function()
|
|
os.copyfile("libmastodont.a", prefix .. "/lib");
|
|
os.execute("install -d include/ " .. prefix .. "/include");
|
|
os.execute("cp -r include/ " .. prefix .. "/include/mastodont");
|
|
os.mkdir(pkgconfig_path);
|
|
os.copyfile("mastodont.pc", pkgconfig_path .. "/mastodont.pc");
|
|
end
|
|
}
|