Added missing ow.lua

This commit is contained in:
starkos 2008-12-01 13:58:34 +00:00
parent b4c4129b53
commit 2484c2e5fa

118
src/base/ow.lua Normal file
View File

@ -0,0 +1,118 @@
--
-- ow.lua
-- Provides Open Watcom-specific configuration strings.
-- Copyright (c) 2008 Jason Perkins and the Premake project
--
premake.ow = { }
--
-- Translation of Premake flags into OpenWatcom flags
--
local cflags =
{
ExtraWarnings = "-wx",
FatalWarning = "-we",
Optimize = "-ox",
OptimizeSize = "-os",
OptimizeSpeed = "-ot",
Symbols = "-d2",
}
local cxxflags =
{
NoExceptions = "-xd",
NoRTTI = "-xr",
}
--
-- Returns the compiler ID used by Code::Blocks.
--
function premake.ow.getcompilervar(cfg)
return iif(cfg.language == "C", "CC", "CC++")
end
--
-- Returns a list of compiler flags, based on the supplied configuration.
--
function premake.ow.getcppflags(cfg)
return ""
end
function premake.ow.getcflags(cfg)
local result = table.translate(cfg.flags, cflags)
if (cfg.flags.Symbols) then
table.insert(result, "-hw") -- Watcom debug format for Watcom debugger
end
return result
end
function premake.ow.getcxxflags(cfg)
local result = table.translate(cfg.flags, cxxflags)
return result
end
--
-- Returns a list of linker flags, based on the supplied configuration.
--
function premake.ow.getldflags(cfg)
local result = { }
if (cfg.flags.Symbols) then
table.insert(result, "op symf")
end
return result
end
--
-- Returns a list of linker flags for library search directories and
-- library names.
--
function premake.ow.getlinkflags(cfg)
local result = { }
return result
end
--
-- Decorate defines for the command line.
--
function premake.ow.getdefines(defines)
local result = { }
for _,def in ipairs(defines) do
table.insert(result, '-D' .. def)
end
return result
end
--
-- Decorate include file search paths for the command line.
--
function premake.ow.getincludedirs(includedirs)
local result = { }
for _,dir in ipairs(includedirs) do
table.insert(result, '-I "' .. dir .. '"')
end
return result
end