-- OPTIONS -------------------------------------------------------------------
--
newoption
{
trigger = "sublua-shared",
description = "Create a dynamically loadable version (dll/so) of SubLua."
}
newoption
{
trigger = "force-debug-symbols",
description = "Forces the debug symbols to be included. Can be used to debug against the release version of lua.exe."
}
newoption
{
trigger = "disable-svn-version-generation",
description = "Turn off prebuild SVN verion generation commands."
}
if os.is( "windows" ) then
--newoption{ trigger = "crtfix", description = "Uses ResourceHacker to update the manifest to fix the multiple VC CRT manifest versions." }
--newoption{ trigger = "install", description = "Installs the compiled dynamicly loadable version into $(LUA_DEV)/clibs.." }
end
-- PROJECT CONFIGURATION -------------------------------------------------------
--
project "SubLua"
if _OPTIONS["sublua-shared"] then
kind "SharedLib"
--defines "SUBLUA_MAKING_DLL"
else
kind "StaticLib"
end
targetprefix "" -- Make sure that the 'lib' prefix is removed for Lua modules.
targetsuffix "" -- Make sure that the 'lib' prefix is removed for Lua modules.
-- PROJECT FILES ---------------------------------------------------------------
--
files { "**.cpp", "**.h", "**.hpp", "**.lua" }
local oldprebuildcommands = prebuildcommands
if _OPTIONS["disable-svn-version-generation"] then
function prebuildcommands( ... ) end
end
MakeVersion( project().name .. "Version.cpp" )
if os.is( "windows" ) then
MakeVersion( project().name..".rc" )
--MakeVersion( "installer/windows/"..package.name..".iss" )
end
if _OPTIONS["disable-svn-version-generation"] then
-- Restore original functionality
prebuildcommands = oldprebuildcommands
end
excludes { "**.template", "tests/support/**.hpp" }
includedirs { "luaxx" }
-- LINKER SETTINGS ------------------------------------------------------------
--
links { "SubCpp" }
-- COMPILER SPECIFIC SETUP ----------------------------------------------------
--
if ActionUsesMSVC() then
linkoptions { "/DEF:sublua.def" }
end
-- OPERATING SYSTEM SPECIFIC SETTINGS -----------------------------------------
--
if os.is( "windows" ) then
if ActionUsesGCC() then
linkoptions { "sublua.def" }
end
elseif os.is( "linux" ) then -- LINUX
else -- MACOSX
end
-- PACKAGE SETUP --------------------------------------------------------------
--
Configure()
if _OPTIONS["force-debug-symbols"] then
config["Release"].buildflags = { "optimize-size" }
config["Release"].buildoptions = { "/Od" }
end
svn.Configure()
lua.Configure()
-- POST-BUILD SETUP -----------------------------------------------------------
--
--[[if windows then
local pathSeparator = "/"
if ActionUsesMSVC() then
pathSeparator = "\\"
end
if _OPTIONS["crtfix"] then
local debugBinary = project().bindir .. pathSeparator .. project().config["Debug"].targetname .. ".dll"
local releaseBinary = project().bindir .. pathSeparator .. project().targetname .. ".dll"
local debugCommand = "support" .. pathSeparator .. "ResHacker.exe -modify " .. debugBinary .. ", " .. debugBinary .. ", support" .. pathSeparator .. "crtfixd.res, 24,2,"
local releaseCommand = "support" .. pathSeparator .. "ResHacker.exe -modify " .. releaseBinary .. ", " .. releaseBinary .. ", support" .. pathSeparator .. "crtfix.res, 24,2,"
--print( releaseCommand, debugCommand )
table.insert( config["Debug"].postbuildcommands(), 1, debugCommand )
config["Release"].postbuildcommands { releaseCommand }
end
end]]