Topic: Premake template for plugins

-----------------------------------------------------------------------------------------------------------------------------
-- Maratis plugin premake template
-----------------------------------------------------------------------------------------------------------------------------

    -- Setup the path to MSDK
    msdk = "MSDK/"

    -- Setup the name of your plugin's folder
    sources_folder = "PluginSources"

-- Setup the solution
solution "Game"

    configurations { "Debug", "Release" }
    platforms { "x32", "x64" }

    if os.is("windows") then defines { "_WIN32", "WIN32" }
    elseif os.is("macosx") then defines { "__APPLE__", "MACOSX" }
    elseif os.is("linux") then defines { "LINUX", "linux" } end

    configuration "Debug"
        defines { "DEBUG" }
        flags { "Symbols" }

    configuration "Release"
        defines { "NDEBUG" }
        flags { "OptimizeSpeed" }

    -- Includes directories
    includedirs { msdk .. "MCore/Includes", msdk .. "MEngine/Includes" }

    -- External libraries
    if os.is("windows") then libdirs { sources_folder } end -- set path to MCore & MEngine (dll for minGW, lib for visual studio)

    -- Build plugin from sources ~ NB: do not rename it here, but strip "lib" from "libGame.so"
    project "Game"
        kind "SharedLib"
        language "C++"
        files { sources_folder .. "/**" }
        if os.is("windows") then links { "MEngine", "MCore" } end

NB: you must edit this script to match the location of Maratis SDK libs and of your plugin sources.
This script must be saved as 'premake4.lua' in your project folder.

Last edited by com3D (2014-01-29 06:06:23)

Re: Premake template for plugins

LINUX
- build using make & GCC 4.6.3 tongue
- build using Code::Blocks 12.11 & GCC 4.6.3 tongue

- tested on Ubuntu Precise tongue
- tested on Slackware 14 tongue


WINDOWS
- build using vs2010 tongue
- build using minGW tongue (requires building Maratis with minGW)

- vs2010 build tested using Wine tongue
- minGW build test using Wine tongue (requires a minGW build of Maratis)


IMPORTANT
- plugin & Maratis must be built using the same compiler/linker.
- for linux users, don't forget to rename your generated plugin as 'Game.so' (instead of 'libGame.so').
- for Windows users, please note that when using absolute path you can't build in debug mode (obviously a bug in Premake4 that strips the path).

TODO: cygwin tests soon as assimp for cygwin gets fixed

Last edited by com3D (2013-10-25 15:27:03)