Initial community commit
This commit is contained in:
85
Src/external_dependencies/openmpt-trunk/include/genie/src/tools/dotnet.lua
vendored
Normal file
85
Src/external_dependencies/openmpt-trunk/include/genie/src/tools/dotnet.lua
vendored
Normal file
@@ -0,0 +1,85 @@
|
||||
--
|
||||
-- dotnet.lua
|
||||
-- Interface for the C# compilers, all of which are flag compatible.
|
||||
-- Copyright (c) 2002-2009 Jason Perkins and the Premake project
|
||||
--
|
||||
|
||||
|
||||
premake.dotnet = { }
|
||||
premake.dotnet.namestyle = "windows"
|
||||
|
||||
|
||||
--
|
||||
-- Translation of Premake flags into CSC flags
|
||||
--
|
||||
|
||||
local flags =
|
||||
{
|
||||
FatalWarning = "/warnaserror",
|
||||
Optimize = "/optimize",
|
||||
OptimizeSize = "/optimize",
|
||||
OptimizeSpeed = "/optimize",
|
||||
Symbols = "/debug",
|
||||
Unsafe = "/unsafe"
|
||||
}
|
||||
|
||||
|
||||
--
|
||||
-- Return the default build action for a given file, based on the file extension.
|
||||
--
|
||||
|
||||
function premake.dotnet.getbuildaction(fcfg)
|
||||
local ext = path.getextension(fcfg.name):lower()
|
||||
if fcfg.buildaction == "Compile" or ext == ".cs" then
|
||||
return "Compile"
|
||||
elseif fcfg.buildaction == "Embed" or ext == ".resx" then
|
||||
return "EmbeddedResource"
|
||||
elseif fcfg.buildaction == "Copy" or ext == ".asax" or ext == ".aspx" then
|
||||
return "Content"
|
||||
else
|
||||
return "None"
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
--
|
||||
-- Returns the compiler filename (they all use the same arguments)
|
||||
--
|
||||
|
||||
function premake.dotnet.getcompilervar(cfg)
|
||||
if (_OPTIONS.dotnet == "msnet") then
|
||||
return "csc"
|
||||
elseif (_OPTIONS.dotnet == "mono") then
|
||||
return "mcs"
|
||||
else
|
||||
return "cscc"
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
--
|
||||
-- Returns a list of compiler flags, based on the supplied configuration.
|
||||
--
|
||||
|
||||
function premake.dotnet.getflags(cfg)
|
||||
local result = table.translate(cfg.flags, flags)
|
||||
return result
|
||||
end
|
||||
|
||||
|
||||
|
||||
--
|
||||
-- Translates the Premake kind into the CSC kind string.
|
||||
--
|
||||
|
||||
function premake.dotnet.getkind(cfg)
|
||||
if (cfg.kind == "ConsoleApp") then
|
||||
return "Exe"
|
||||
elseif (cfg.kind == "WindowedApp") then
|
||||
return "WinExe"
|
||||
elseif (cfg.kind == "SharedLib") then
|
||||
return "Library"
|
||||
end
|
||||
end
|
||||
398
Src/external_dependencies/openmpt-trunk/include/genie/src/tools/gcc.lua
vendored
Normal file
398
Src/external_dependencies/openmpt-trunk/include/genie/src/tools/gcc.lua
vendored
Normal file
@@ -0,0 +1,398 @@
|
||||
--
|
||||
-- gcc.lua
|
||||
-- Provides GCC-specific configuration strings.
|
||||
-- Copyright (c) 2002-2011 Jason Perkins and the Premake project
|
||||
--
|
||||
|
||||
|
||||
premake.gcc = { }
|
||||
|
||||
|
||||
--
|
||||
-- Set default tools
|
||||
--
|
||||
|
||||
premake.gcc.cc = "gcc"
|
||||
premake.gcc.cxx = "g++"
|
||||
premake.gcc.ar = "ar"
|
||||
premake.gcc.rc = "windres"
|
||||
premake.gcc.llvm = false
|
||||
|
||||
|
||||
--
|
||||
-- Translation of Premake flags into GCC flags
|
||||
--
|
||||
|
||||
local cflags =
|
||||
{
|
||||
EnableSSE = "-msse",
|
||||
EnableSSE2 = "-msse2",
|
||||
EnableAVX = "-mavx",
|
||||
EnableAVX2 = "-mavx2",
|
||||
PedanticWarnings = "-Wall -Wextra -pedantic",
|
||||
ExtraWarnings = "-Wall -Wextra",
|
||||
FatalWarnings = "-Werror",
|
||||
FloatFast = "-ffast-math",
|
||||
FloatStrict = "-ffloat-store",
|
||||
NoFramePointer = "-fomit-frame-pointer",
|
||||
Optimize = "-O2",
|
||||
OptimizeSize = "-Os",
|
||||
OptimizeSpeed = "-O3",
|
||||
Symbols = "-g",
|
||||
}
|
||||
|
||||
local cxxflags =
|
||||
{
|
||||
Cpp11 = "-std=c++11",
|
||||
Cpp14 = "-std=c++14",
|
||||
Cpp17 = "-std=c++17",
|
||||
CppLatest = "-std=c++2a",
|
||||
NoExceptions = "-fno-exceptions",
|
||||
NoRTTI = "-fno-rtti",
|
||||
UnsignedChar = "-funsigned-char",
|
||||
}
|
||||
|
||||
local objcflags =
|
||||
{
|
||||
ObjcARC = "-fobjc-arc",
|
||||
}
|
||||
|
||||
--
|
||||
-- Map platforms to flags
|
||||
--
|
||||
|
||||
premake.gcc.platforms =
|
||||
{
|
||||
Native = {
|
||||
cppflags = "-MMD -MP",
|
||||
},
|
||||
x32 = {
|
||||
cppflags = "-MMD -MP",
|
||||
flags = "-m32",
|
||||
},
|
||||
x64 = {
|
||||
cppflags = "-MMD -MP",
|
||||
flags = "-m64",
|
||||
},
|
||||
Universal = {
|
||||
ar = "libtool",
|
||||
cppflags = "-MMD -MP",
|
||||
flags = "-arch i386 -arch x86_64 -arch ppc -arch ppc64",
|
||||
},
|
||||
Universal32 = {
|
||||
ar = "libtool",
|
||||
cppflags = "-MMD -MP",
|
||||
flags = "-arch i386 -arch ppc",
|
||||
},
|
||||
Universal64 = {
|
||||
ar = "libtool",
|
||||
cppflags = "-MMD -MP",
|
||||
flags = "-arch x86_64 -arch ppc64",
|
||||
},
|
||||
PS3 = {
|
||||
cc = "ppu-lv2-g++",
|
||||
cxx = "ppu-lv2-g++",
|
||||
ar = "ppu-lv2-ar",
|
||||
cppflags = "-MMD -MP",
|
||||
},
|
||||
WiiDev = {
|
||||
cppflags = "-MMD -MP -I$(LIBOGC_INC) $(MACHDEP)",
|
||||
ldflags = "-L$(LIBOGC_LIB) $(MACHDEP)",
|
||||
cfgsettings = [[
|
||||
ifeq ($(strip $(DEVKITPPC)),)
|
||||
$(error "DEVKITPPC environment variable is not set")'
|
||||
endif
|
||||
include $(DEVKITPPC)/wii_rules']],
|
||||
},
|
||||
Orbis = {
|
||||
cc = "orbis-clang",
|
||||
cxx = "orbis-clang++",
|
||||
ar = "orbis-ar",
|
||||
cppflags = "-MMD -MP",
|
||||
},
|
||||
Emscripten = {
|
||||
cc = "$(EMSCRIPTEN)/emcc",
|
||||
cxx = "$(EMSCRIPTEN)/em++",
|
||||
ar = "$(EMSCRIPTEN)/emar",
|
||||
cppflags = "-MMD -MP",
|
||||
},
|
||||
NX32 = {
|
||||
cc = "clang",
|
||||
cxx = "clang++",
|
||||
ar = "armv7l-nintendo-nx-eabihf-ar",
|
||||
cppflags = "-MMD -MP",
|
||||
flags = "-march=armv7l",
|
||||
},
|
||||
NX64 = {
|
||||
cc = "clang",
|
||||
cxx = "clang++",
|
||||
ar = "aarch64-nintendo-nx-elf-ar",
|
||||
cppflags = "-MMD -MP",
|
||||
flags = "-march=aarch64",
|
||||
},
|
||||
}
|
||||
|
||||
local platforms = premake.gcc.platforms
|
||||
|
||||
|
||||
--
|
||||
-- Returns a list of compiler flags, based on the supplied configuration.
|
||||
--
|
||||
|
||||
function premake.gcc.getcppflags(cfg)
|
||||
local flags = { }
|
||||
table.insert(flags, platforms[cfg.platform].cppflags)
|
||||
|
||||
-- We want the -MP flag for dependency generation (creates phony rules
|
||||
-- for headers, prevents make errors if file is later deleted)
|
||||
if flags[1]:startswith("-MMD") then
|
||||
table.insert(flags, "-MP")
|
||||
end
|
||||
|
||||
return flags
|
||||
end
|
||||
|
||||
|
||||
function premake.gcc.getcflags(cfg)
|
||||
local result = table.translate(cfg.flags, cflags)
|
||||
table.insert(result, platforms[cfg.platform].flags)
|
||||
if cfg.system ~= "windows" and cfg.kind == "SharedLib" then
|
||||
table.insert(result, "-fPIC")
|
||||
end
|
||||
return result
|
||||
end
|
||||
|
||||
|
||||
function premake.gcc.getcxxflags(cfg)
|
||||
local result = table.translate(cfg.flags, cxxflags)
|
||||
return result
|
||||
end
|
||||
|
||||
|
||||
function premake.gcc.getobjcflags(cfg)
|
||||
return table.translate(cfg.flags, objcflags)
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- Returns a list of linker flags, based on the supplied configuration.
|
||||
--
|
||||
|
||||
function premake.gcc.getldflags(cfg)
|
||||
local result = { }
|
||||
|
||||
-- OS X has a bug, see http://lists.apple.com/archives/Darwin-dev/2006/Sep/msg00084.html
|
||||
if not cfg.flags.Symbols then
|
||||
if cfg.system == "macosx" then
|
||||
-- Issue#80
|
||||
-- https://github.com/bkaradzic/genie/issues/80#issuecomment-100664007
|
||||
-- table.insert(result, "-Wl,-x")
|
||||
else
|
||||
table.insert(result, "-s")
|
||||
end
|
||||
end
|
||||
|
||||
if cfg.kind == "Bundle" then
|
||||
table.insert(result, "-bundle")
|
||||
end
|
||||
|
||||
if cfg.kind == "SharedLib" then
|
||||
if cfg.system == "macosx" then
|
||||
table.insert(result, "-dynamiclib")
|
||||
else
|
||||
table.insert(result, "-shared")
|
||||
end
|
||||
|
||||
if cfg.system == "windows" and not cfg.flags.NoImportLib then
|
||||
table.insert(result, '-Wl,--out-implib="' .. cfg.linktarget.fullpath .. '"')
|
||||
end
|
||||
end
|
||||
|
||||
if cfg.kind == "WindowedApp" and cfg.system == "windows" then
|
||||
table.insert(result, "-mwindows")
|
||||
end
|
||||
|
||||
local platform = platforms[cfg.platform]
|
||||
table.insert(result, platform.flags)
|
||||
table.insert(result, platform.ldflags)
|
||||
|
||||
return result
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- Return a list of library search paths. Technically part of LDFLAGS but need to
|
||||
-- be separated because of the way Visual Studio calls GCC for the PS3. See bug
|
||||
-- #1729227 for background on why library paths must be split.
|
||||
--
|
||||
|
||||
function premake.gcc.getlibdirflags(cfg)
|
||||
local result = { }
|
||||
for _, value in ipairs(premake.getlinks(cfg, "all", "directory")) do
|
||||
table.insert(result, '-L\"' .. value .. '\"')
|
||||
end
|
||||
return result
|
||||
end
|
||||
|
||||
--
|
||||
-- Given a path, return true if it's considered a real path
|
||||
-- to a library file, false otherwise.
|
||||
-- p: path
|
||||
--
|
||||
function premake.gcc.islibfile(p)
|
||||
if path.getextension(p) == ".a" then
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
--
|
||||
-- Returns a list of project-relative paths to external library files.
|
||||
-- This function examines the linker flags and returns any that seem to be
|
||||
-- a real path to a library file (e.g. "path/to/a/library.a", but not "GL").
|
||||
-- Useful for adding to targets to trigger a relink when an external static
|
||||
-- library gets updated.
|
||||
-- cfg: configuration
|
||||
--
|
||||
function premake.gcc.getlibfiles(cfg)
|
||||
local result = {}
|
||||
for _, value in ipairs(premake.getlinks(cfg, "system", "fullpath")) do
|
||||
if premake.gcc.islibfile(value) then
|
||||
table.insert(result, _MAKE.esc(value))
|
||||
end
|
||||
end
|
||||
return result
|
||||
end
|
||||
|
||||
--
|
||||
-- This is poorly named: returns a list of linker flags for external
|
||||
-- (i.e. system, or non-sibling) libraries. See bug #1729227 for
|
||||
-- background on why the path must be split.
|
||||
--
|
||||
|
||||
function premake.gcc.getlinkflags(cfg)
|
||||
local result = {}
|
||||
for _, value in ipairs(premake.getlinks(cfg, "system", "fullpath")) do
|
||||
if premake.gcc.islibfile(value) then
|
||||
value = path.rebase(value, cfg.project.location, cfg.location)
|
||||
table.insert(result, _MAKE.esc(value))
|
||||
elseif path.getextension(value) == ".framework" then
|
||||
table.insert(result, '-framework ' .. _MAKE.esc(path.getbasename(value)))
|
||||
else
|
||||
table.insert(result, '-l' .. _MAKE.esc(path.getname(value)))
|
||||
end
|
||||
end
|
||||
return result
|
||||
end
|
||||
|
||||
--
|
||||
-- Get the arguments for whole-archive linking.
|
||||
--
|
||||
|
||||
function premake.gcc.wholearchive(lib)
|
||||
if premake.gcc.llvm then
|
||||
return {"-force_load", lib}
|
||||
elseif os.get() == "macosx" then
|
||||
return {"-Wl,-force_load", lib}
|
||||
else
|
||||
return {"-Wl,--whole-archive", lib, "-Wl,--no-whole-archive"}
|
||||
end
|
||||
end
|
||||
|
||||
--
|
||||
-- Get flags for passing to AR before the target is appended to the commandline
|
||||
-- prj: project
|
||||
-- cfg: configuration
|
||||
-- ndx: true if the final step of a split archive
|
||||
--
|
||||
|
||||
function premake.gcc.getarchiveflags(prj, cfg, ndx)
|
||||
local result = {}
|
||||
if cfg.platform:startswith("Universal") then
|
||||
if prj.options.ArchiveSplit then
|
||||
error("gcc tool 'Universal*' platforms do not support split archives")
|
||||
end
|
||||
table.insert(result, '-o')
|
||||
else
|
||||
if (not prj.options.ArchiveSplit) then
|
||||
if premake.gcc.llvm then
|
||||
table.insert(result, 'rcs')
|
||||
else
|
||||
table.insert(result, '-rcs')
|
||||
end
|
||||
else
|
||||
if premake.gcc.llvm then
|
||||
if (not ndx) then
|
||||
table.insert(result, 'qc')
|
||||
else
|
||||
table.insert(result, 'cs')
|
||||
end
|
||||
else
|
||||
if (not ndx) then
|
||||
table.insert(result, '-qc')
|
||||
else
|
||||
table.insert(result, '-cs')
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
return result
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- Decorate defines for the GCC command line.
|
||||
--
|
||||
|
||||
function premake.gcc.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 GCC command line.
|
||||
--
|
||||
|
||||
function premake.gcc.getincludedirs(includedirs)
|
||||
local result = { }
|
||||
for _,dir in ipairs(includedirs) do
|
||||
table.insert(result, "-I\"" .. dir .. "\"")
|
||||
end
|
||||
return result
|
||||
end
|
||||
|
||||
--
|
||||
-- Decorate user include file search paths for the GCC command line.
|
||||
--
|
||||
|
||||
function premake.gcc.getquoteincludedirs(includedirs)
|
||||
local result = { }
|
||||
for _,dir in ipairs(includedirs) do
|
||||
table.insert(result, "-iquote \"" .. dir .. "\"")
|
||||
end
|
||||
return result
|
||||
end
|
||||
|
||||
--
|
||||
-- Decorate system include file search paths for the GCC command line.
|
||||
--
|
||||
|
||||
function premake.gcc.getsystemincludedirs(includedirs)
|
||||
local result = { }
|
||||
for _,dir in ipairs(includedirs) do
|
||||
table.insert(result, "-isystem \"" .. dir .. "\"")
|
||||
end
|
||||
return result
|
||||
end
|
||||
|
||||
--
|
||||
-- Return platform specific project and configuration level
|
||||
-- makesettings blocks.
|
||||
--
|
||||
|
||||
function premake.gcc.getcfgsettings(cfg)
|
||||
return platforms[cfg.platform].cfgsettings
|
||||
end
|
||||
201
Src/external_dependencies/openmpt-trunk/include/genie/src/tools/ghs.lua
vendored
Normal file
201
Src/external_dependencies/openmpt-trunk/include/genie/src/tools/ghs.lua
vendored
Normal file
@@ -0,0 +1,201 @@
|
||||
--
|
||||
-- ghs.lua
|
||||
-- Provides Green Hills Software-specific configuration strings.
|
||||
--
|
||||
|
||||
premake.ghs = { }
|
||||
premake.ghs.namestyle = "PS3"
|
||||
|
||||
|
||||
--
|
||||
-- Set default tools
|
||||
--
|
||||
|
||||
premake.ghs.cc = "ccppc"
|
||||
premake.ghs.cxx = "cxppc"
|
||||
premake.ghs.ar = "cxppc"
|
||||
|
||||
|
||||
--
|
||||
-- Translation of Premake flags into GHS flags
|
||||
--
|
||||
|
||||
local cflags =
|
||||
{
|
||||
FatalWarnings = "--quit_after_warnings",
|
||||
Optimize = "-Ogeneral",
|
||||
OptimizeSize = "-Osize",
|
||||
OptimizeSpeed = "-Ospeed",
|
||||
Symbols = "-g",
|
||||
}
|
||||
|
||||
local cxxflags =
|
||||
{
|
||||
NoExceptions = "--no_exceptions",
|
||||
NoRTTI = "--no_rtti",
|
||||
UnsignedChar = "--unsigned_chars",
|
||||
}
|
||||
|
||||
|
||||
--
|
||||
-- Map platforms to flags
|
||||
--
|
||||
|
||||
premake.ghs.platforms =
|
||||
{
|
||||
Native = {
|
||||
cppflags = "-MMD",
|
||||
},
|
||||
PowerPC = {
|
||||
cc = "ccppc",
|
||||
cxx = "cxppc",
|
||||
ar = "cxppc",
|
||||
cppflags = "-MMD",
|
||||
arflags = "-archive -o",
|
||||
},
|
||||
ARM = {
|
||||
cc = "ccarm",
|
||||
cxx = "cxarm",
|
||||
ar = "cxarm",
|
||||
cppflags = "-MMD",
|
||||
arflags = "-archive -o",
|
||||
}
|
||||
}
|
||||
|
||||
local platforms = premake.ghs.platforms
|
||||
|
||||
|
||||
--
|
||||
-- Returns a list of compiler flags, based on the supplied configuration.
|
||||
--
|
||||
|
||||
function premake.ghs.getcppflags(cfg)
|
||||
local flags = { }
|
||||
table.insert(flags, platforms[cfg.platform].cppflags)
|
||||
return flags
|
||||
end
|
||||
|
||||
|
||||
function premake.ghs.getcflags(cfg)
|
||||
local result = table.translate(cfg.flags, cflags)
|
||||
table.insert(result, platforms[cfg.platform].flags)
|
||||
return result
|
||||
end
|
||||
|
||||
|
||||
function premake.ghs.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.ghs.getldflags(cfg)
|
||||
local result = { }
|
||||
|
||||
local platform = platforms[cfg.platform]
|
||||
table.insert(result, platform.flags)
|
||||
table.insert(result, platform.ldflags)
|
||||
|
||||
return result
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- Return a list of library search paths. Technically part of LDFLAGS but need to
|
||||
-- be separated because of the way Visual Studio calls GCC for the PS3. See bug
|
||||
-- #1729227 for background on why library paths must be split.
|
||||
--
|
||||
|
||||
function premake.ghs.getlibdirflags(cfg)
|
||||
local result = { }
|
||||
for _, value in ipairs(premake.getlinks(cfg, "all", "directory")) do
|
||||
table.insert(result, '-L' .. _MAKE.esc(value))
|
||||
end
|
||||
return result
|
||||
end
|
||||
|
||||
-- Returns a list of project-relative paths to external library files.
|
||||
-- This function should examine the linker flags and return any that seem to be
|
||||
-- a real path to a library file (e.g. "path/to/a/library.a", but not "GL").
|
||||
-- Useful for adding to targets to trigger a relink when an external static
|
||||
-- library gets updated.
|
||||
-- Not currently supported on this toolchain.
|
||||
--
|
||||
function premake.ghs.getlibfiles(cfg)
|
||||
local result = {}
|
||||
return result
|
||||
end
|
||||
|
||||
--
|
||||
-- This is poorly named: returns a list of linker flags for external
|
||||
-- (i.e. system, or non-sibling) libraries. See bug #1729227 for
|
||||
-- background on why the path must be split.
|
||||
--
|
||||
|
||||
function premake.ghs.getlinkflags(cfg)
|
||||
local result = {}
|
||||
for _, value in ipairs(premake.getlinks(cfg, "system", "name")) do
|
||||
table.insert(result, '-lnk=' .. _MAKE.esc(value))
|
||||
end
|
||||
return result
|
||||
end
|
||||
|
||||
--
|
||||
-- Get flags for passing to AR before the target is appended to the commandline
|
||||
-- prj: project
|
||||
-- cfg: configuration
|
||||
-- ndx: true if the final step of a split archive
|
||||
--
|
||||
|
||||
function premake.ghs.getarchiveflags(prj, cfg, ndx)
|
||||
if prj.options.ArchiveSplit then
|
||||
error("ghs tool does not support split archives")
|
||||
end
|
||||
|
||||
local result = {}
|
||||
local platform = platforms[cfg.platform]
|
||||
table.insert(result, platform.arflags)
|
||||
return result
|
||||
end
|
||||
|
||||
|
||||
|
||||
--
|
||||
-- Decorate defines for the GHS command line.
|
||||
--
|
||||
|
||||
function premake.ghs.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 GCC command line.
|
||||
--
|
||||
|
||||
function premake.ghs.getincludedirs(includedirs)
|
||||
local result = { }
|
||||
for _,dir in ipairs(includedirs) do
|
||||
table.insert(result, "-I" .. _MAKE.esc(dir))
|
||||
end
|
||||
return result
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- Return platform specific project and configuration level
|
||||
-- makesettings blocks.
|
||||
--
|
||||
|
||||
function premake.ghs.getcfgsettings(cfg)
|
||||
return platforms[cfg.platform].cfgsettings
|
||||
end
|
||||
9
Src/external_dependencies/openmpt-trunk/include/genie/src/tools/msc.lua
vendored
Normal file
9
Src/external_dependencies/openmpt-trunk/include/genie/src/tools/msc.lua
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
--
|
||||
-- msc.lua
|
||||
-- Interface for the MS C/C++ compiler.
|
||||
-- Copyright (c) 2009 Jason Perkins and the Premake project
|
||||
--
|
||||
|
||||
|
||||
premake.msc = { }
|
||||
premake.msc.namestyle = "windows"
|
||||
146
Src/external_dependencies/openmpt-trunk/include/genie/src/tools/ow.lua
vendored
Normal file
146
Src/external_dependencies/openmpt-trunk/include/genie/src/tools/ow.lua
vendored
Normal file
@@ -0,0 +1,146 @@
|
||||
--
|
||||
-- ow.lua
|
||||
-- Provides Open Watcom-specific configuration strings.
|
||||
-- Copyright (c) 2008 Jason Perkins and the Premake project
|
||||
--
|
||||
|
||||
premake.ow = { }
|
||||
premake.ow.namestyle = "windows"
|
||||
|
||||
|
||||
--
|
||||
-- Set default tools
|
||||
--
|
||||
|
||||
premake.ow.cc = "WCL386"
|
||||
premake.ow.cxx = "WCL386"
|
||||
premake.ow.ar = "ar"
|
||||
|
||||
|
||||
--
|
||||
-- Translation of Premake flags into OpenWatcom flags
|
||||
--
|
||||
|
||||
local cflags =
|
||||
{
|
||||
PedanticWarnings = "-wx",
|
||||
ExtraWarnings = "-wx",
|
||||
FatalWarning = "-we",
|
||||
FloatFast = "-omn",
|
||||
FloatStrict = "-op",
|
||||
Optimize = "-ox",
|
||||
OptimizeSize = "-os",
|
||||
OptimizeSpeed = "-ot",
|
||||
Symbols = "-d2",
|
||||
}
|
||||
|
||||
local cxxflags =
|
||||
{
|
||||
NoExceptions = "-xd",
|
||||
NoRTTI = "-xr",
|
||||
}
|
||||
|
||||
|
||||
|
||||
--
|
||||
-- No specific platform support yet
|
||||
--
|
||||
|
||||
premake.ow.platforms =
|
||||
{
|
||||
Native = {
|
||||
flags = ""
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
|
||||
--
|
||||
-- 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 project-relative paths to external library files.
|
||||
-- This function should examine the linker flags and return any that seem to be
|
||||
-- a real path to a library file (e.g. "path/to/a/library.a", but not "GL").
|
||||
-- Useful for adding to targets to trigger a relink when an external static
|
||||
-- library gets updated.
|
||||
-- Not currently supported on this toolchain.
|
||||
--
|
||||
function premake.ow.getlibfiles(cfg)
|
||||
local result = {}
|
||||
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
|
||||
|
||||
179
Src/external_dependencies/openmpt-trunk/include/genie/src/tools/snc.lua
vendored
Normal file
179
Src/external_dependencies/openmpt-trunk/include/genie/src/tools/snc.lua
vendored
Normal file
@@ -0,0 +1,179 @@
|
||||
--
|
||||
-- snc.lua
|
||||
-- Provides Sony SNC-specific configuration strings.
|
||||
-- Copyright (c) 2010 Jason Perkins and the Premake project
|
||||
--
|
||||
|
||||
|
||||
premake.snc = { }
|
||||
|
||||
|
||||
-- TODO: Will cfg.system == "windows" ever be true for SNC? If
|
||||
-- not, remove the conditional blocks that use this test.
|
||||
|
||||
--
|
||||
-- Set default tools
|
||||
--
|
||||
|
||||
premake.snc.cc = "snc"
|
||||
premake.snc.cxx = "g++"
|
||||
premake.snc.ar = "ar"
|
||||
|
||||
|
||||
--
|
||||
-- Translation of Premake flags into SNC flags
|
||||
--
|
||||
|
||||
local cflags =
|
||||
{
|
||||
PedanticWarnings = "-Xdiag=2",
|
||||
ExtraWarnings = "-Xdiag=2",
|
||||
FatalWarnings = "-Xquit=2",
|
||||
}
|
||||
|
||||
local cxxflags =
|
||||
{
|
||||
NoExceptions = "", -- No exceptions is the default in the SNC compiler.
|
||||
NoRTTI = "-Xc-=rtti",
|
||||
}
|
||||
|
||||
|
||||
--
|
||||
-- Map platforms to flags
|
||||
--
|
||||
|
||||
premake.snc.platforms =
|
||||
{
|
||||
PS3 = {
|
||||
cc = "ppu-lv2-g++",
|
||||
cxx = "ppu-lv2-g++",
|
||||
ar = "ppu-lv2-ar",
|
||||
cppflags = "-MMD -MP",
|
||||
}
|
||||
}
|
||||
|
||||
local platforms = premake.snc.platforms
|
||||
|
||||
|
||||
--
|
||||
-- Returns a list of compiler flags, based on the supplied configuration.
|
||||
--
|
||||
|
||||
function premake.snc.getcppflags(cfg)
|
||||
local result = { }
|
||||
table.insert(result, platforms[cfg.platform].cppflags)
|
||||
return result
|
||||
end
|
||||
|
||||
function premake.snc.getcflags(cfg)
|
||||
local result = table.translate(cfg.flags, cflags)
|
||||
table.insert(result, platforms[cfg.platform].flags)
|
||||
if cfg.kind == "SharedLib" then
|
||||
table.insert(result, "-fPIC")
|
||||
end
|
||||
|
||||
return result
|
||||
end
|
||||
|
||||
function premake.snc.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.snc.getldflags(cfg)
|
||||
local result = { }
|
||||
|
||||
if not cfg.flags.Symbols then
|
||||
table.insert(result, "-s")
|
||||
end
|
||||
|
||||
if cfg.kind == "SharedLib" then
|
||||
table.insert(result, "-shared")
|
||||
if not cfg.flags.NoImportLib then
|
||||
table.insert(result, '-Wl,--out-implib="' .. cfg.linktarget.fullpath .. '"')
|
||||
end
|
||||
end
|
||||
|
||||
local platform = platforms[cfg.platform]
|
||||
table.insert(result, platform.flags)
|
||||
table.insert(result, platform.ldflags)
|
||||
|
||||
return result
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- Return a list of library search paths. Technically part of LDFLAGS but need to
|
||||
-- be separated because of the way Visual Studio calls SNC for the PS3. See bug
|
||||
-- #1729227 for background on why library paths must be split.
|
||||
--
|
||||
|
||||
function premake.snc.getlibdirflags(cfg)
|
||||
local result = { }
|
||||
for _, value in ipairs(premake.getlinks(cfg, "all", "directory")) do
|
||||
table.insert(result, '-L' .. _MAKE.esc(value))
|
||||
end
|
||||
return result
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- Returns a list of project-relative paths to external library files.
|
||||
-- This function should examine the linker flags and return any that seem to be
|
||||
-- a real path to a library file (e.g. "path/to/a/library.a", but not "GL").
|
||||
-- Useful for adding to targets to trigger a relink when an external static
|
||||
-- library gets updated.
|
||||
-- Not currently supported on this toolchain.
|
||||
--
|
||||
function premake.snc.getlibfiles(cfg)
|
||||
local result = {}
|
||||
return result
|
||||
end
|
||||
|
||||
--
|
||||
-- This is poorly named: returns a list of linker flags for external
|
||||
-- (i.e. system, or non-sibling) libraries. See bug #1729227 for
|
||||
-- background on why the path must be split.
|
||||
--
|
||||
|
||||
function premake.snc.getlinkflags(cfg)
|
||||
local result = {}
|
||||
for _, value in ipairs(premake.getlinks(cfg, "system", "name")) do
|
||||
table.insert(result, '-l' .. _MAKE.esc(value))
|
||||
end
|
||||
return result
|
||||
end
|
||||
|
||||
|
||||
|
||||
--
|
||||
-- Decorate defines for the SNC command line.
|
||||
--
|
||||
|
||||
function premake.snc.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 SNC command line.
|
||||
--
|
||||
|
||||
function premake.snc.getincludedirs(includedirs)
|
||||
local result = { }
|
||||
for _,dir in ipairs(includedirs) do
|
||||
table.insert(result, "-I" .. _MAKE.esc(dir))
|
||||
end
|
||||
return result
|
||||
end
|
||||
141
Src/external_dependencies/openmpt-trunk/include/genie/src/tools/swift.lua
vendored
Normal file
141
Src/external_dependencies/openmpt-trunk/include/genie/src/tools/swift.lua
vendored
Normal file
@@ -0,0 +1,141 @@
|
||||
--
|
||||
-- swift.lua
|
||||
-- Provides Swift-specific configuration strings.
|
||||
--
|
||||
|
||||
|
||||
premake.swift = { }
|
||||
|
||||
|
||||
--
|
||||
-- Set default tools
|
||||
--
|
||||
|
||||
premake.swift.swiftc = "swiftc"
|
||||
premake.swift.swift = "swift"
|
||||
premake.swift.cc = "gcc"
|
||||
premake.swift.ar = "ar"
|
||||
premake.swift.ld = "ld"
|
||||
premake.swift.dsymutil = "dsymutil"
|
||||
|
||||
|
||||
--
|
||||
-- Translation of Premake flags into Swift flags
|
||||
--
|
||||
|
||||
local swiftcflags =
|
||||
{
|
||||
Symbols = "-g", -- Produce debug information
|
||||
DisableWarnings = "--suppress-warnings", -- Disable warnings
|
||||
FatalWarnings = "--warnings-as-errors", -- Treat warnings as fatal
|
||||
Optimize = "-O -whole-module-optimization",
|
||||
OptimizeSize = "-O -whole-module-optimization",
|
||||
OptimizeSpeed = "-Ounchecked -whole-module-optimization",
|
||||
MinimumWarnings = "-minimum-warnings",
|
||||
}
|
||||
|
||||
local swiftlinkflags = {
|
||||
StaticRuntime = "-static-stdlib",
|
||||
}
|
||||
|
||||
premake.swift.platforms = {
|
||||
Native = {
|
||||
swiftcflags = "",
|
||||
swiftlinkflags = "",
|
||||
},
|
||||
x64 = {
|
||||
swiftcflags = "",
|
||||
swiftlinkflags = "",
|
||||
}
|
||||
}
|
||||
|
||||
local platforms = premake.swift.platforms
|
||||
|
||||
--
|
||||
-- Returns a list of compiler flags, based on the supplied configuration.
|
||||
--
|
||||
|
||||
function premake.swift.get_sdk_path(cfg)
|
||||
return string.trim(os.outputof("xcrun --show-sdk-path"))
|
||||
end
|
||||
|
||||
function premake.swift.get_sdk_platform_path(cfg)
|
||||
return string.trim(os.outputof("xcrun --show-sdk-platform-path"))
|
||||
end
|
||||
|
||||
function premake.swift.get_toolchain_path(cfg)
|
||||
return string.trim(os.outputof("xcode-select -p")) .. "/Toolchains/XcodeDefault.xctoolchain"
|
||||
end
|
||||
|
||||
function premake.swift.gettarget(cfg)
|
||||
return "-target x86_64-apple-macosx10.11"
|
||||
end
|
||||
|
||||
function premake.swift.getswiftcflags(cfg)
|
||||
local result = table.translate(cfg.flags, swiftcflags)
|
||||
table.insert(result, platforms[cfg.platform].swiftcflags)
|
||||
|
||||
result = table.join(result, cfg.buildoptions_swift)
|
||||
|
||||
if cfg.kind == "SharedLib" or cfg.kind == "StaticLib" then
|
||||
table.insert(result, "-parse-as-library")
|
||||
end
|
||||
|
||||
table.insert(result, premake.swift.gettarget(cfg))
|
||||
|
||||
return result
|
||||
end
|
||||
|
||||
function premake.swift.getswiftlinkflags(cfg)
|
||||
local result = table.translate(cfg.flags, swiftlinkflags)
|
||||
table.insert(result, platforms[cfg.platform].swiftlinkflags)
|
||||
|
||||
result = table.join(result, cfg.linkoptions_swift)
|
||||
|
||||
if cfg.kind == "SharedLib" or cfg.kind == "StaticLib" then
|
||||
table.insert(result, "-emit-library")
|
||||
else
|
||||
table.insert(result, "-emit-executable")
|
||||
end
|
||||
|
||||
table.insert(result, premake.swift.gettarget(cfg))
|
||||
|
||||
return result
|
||||
end
|
||||
|
||||
function premake.swift.getmodulemaps(cfg)
|
||||
local maps = {}
|
||||
if next(cfg.swiftmodulemaps) then
|
||||
for _, mod in ipairs(cfg.swiftmodulemaps) do
|
||||
table.insert(maps, string.format("-Xcc -fmodule-map-file=%s", mod))
|
||||
end
|
||||
end
|
||||
return maps
|
||||
end
|
||||
|
||||
function premake.swift.getlibdirflags(cfg)
|
||||
return premake.gcc.getlibdirflags(cfg)
|
||||
end
|
||||
|
||||
function premake.swift.getldflags(cfg)
|
||||
local result = { platforms[cfg.platform].ldflags }
|
||||
|
||||
local links = premake.getlinks(cfg, "siblings", "basename")
|
||||
for _,v in ipairs(links) do
|
||||
if path.getextension(v) == ".framework" then
|
||||
table.insert(result, "-framework "..v)
|
||||
else
|
||||
table.insert(result, "-l"..v)
|
||||
end
|
||||
end
|
||||
|
||||
return result
|
||||
end
|
||||
|
||||
function premake.swift.getlinkflags(cfg)
|
||||
return premake.gcc.getlinkflags(cfg)
|
||||
end
|
||||
|
||||
function premake.swift.getarchiveflags(cfg)
|
||||
return ""
|
||||
end
|
||||
121
Src/external_dependencies/openmpt-trunk/include/genie/src/tools/valac.lua
vendored
Normal file
121
Src/external_dependencies/openmpt-trunk/include/genie/src/tools/valac.lua
vendored
Normal file
@@ -0,0 +1,121 @@
|
||||
--
|
||||
-- valac.lua
|
||||
-- Provides valac-specific configuration strings.
|
||||
--
|
||||
|
||||
|
||||
premake.valac = { }
|
||||
|
||||
|
||||
--
|
||||
-- Set default tools
|
||||
--
|
||||
|
||||
premake.valac.valac = "valac"
|
||||
premake.valac.cc = premake.gcc.cc
|
||||
premake.valac.glibrc = "glib-compile-resources"
|
||||
|
||||
|
||||
--
|
||||
-- Translation of Premake flags into GCC flags
|
||||
--
|
||||
|
||||
local valaflags =
|
||||
{
|
||||
DisableAssert = "--disable-assert", -- Disable assertions
|
||||
DisableSinceCheck = "--disable-since-check", -- Do not check whether used symbols exist in local packages
|
||||
DisableWarnings = "--disable-warnings", -- Disable warnings
|
||||
EnableChecking = "--enable-checking", -- Enable additional run-time checks
|
||||
EnableDeprecated = "--enable-deprecated", -- Enable deprecated features
|
||||
EnableExperimental = "--enable-experimental", -- Enable experimental features
|
||||
EnableExperimentalNonNull = "--enable-experimental-non-null", -- Enable experimental enhancements for non-null types
|
||||
EnableGObjectTracing = "--enable-gobject-tracing", -- Enable GObject creation tracing
|
||||
EnableMemProfiler = "--enable-mem-profiler", -- Enable GLib memory profiler
|
||||
FatalWarnings = "--fatal-warnings", -- Treat warnings as fatal
|
||||
HideInternal = "--hide-internal", -- Hide symbols marked as internal
|
||||
NoStdPkg = "--nostdpkg", -- Do not include standard packages
|
||||
Symbols = "-g", -- Produce debug information
|
||||
}
|
||||
|
||||
local valaccflags =
|
||||
{
|
||||
Optimize = "-O2",
|
||||
OptimizeSize = "-Os",
|
||||
OptimizeSpeed = "-O3",
|
||||
Symbols = "-g", -- Produce debug information
|
||||
}
|
||||
|
||||
--
|
||||
-- Map platforms to flags
|
||||
--
|
||||
|
||||
premake.valac.platforms =
|
||||
{
|
||||
Native = {
|
||||
},
|
||||
x64 = {
|
||||
flags = "-m64"
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
|
||||
--
|
||||
-- Returns a list of compiler flags for `valac`, based on the supplied configuration.
|
||||
--
|
||||
|
||||
function premake.valac.getvalaflags(cfg)
|
||||
return table.translate(cfg.flags, valaflags)
|
||||
end
|
||||
|
||||
|
||||
|
||||
--
|
||||
-- Returns a list of compiler flags for `cc`, based on the supplied configuration.
|
||||
--
|
||||
|
||||
function premake.valac.getvalaccflags(cfg)
|
||||
return table.translate(cfg.flags, valaccflags)
|
||||
end
|
||||
|
||||
|
||||
|
||||
--
|
||||
-- Decorate pkgs for the Vala command line.
|
||||
--
|
||||
|
||||
function premake.valac.getlinks(links)
|
||||
local result = { }
|
||||
for _, pkg in ipairs(links) do
|
||||
table.insert(result, '--pkg ' .. pkg)
|
||||
end
|
||||
return result
|
||||
end
|
||||
|
||||
|
||||
|
||||
--
|
||||
-- Decorate defines for the Vala command line.
|
||||
--
|
||||
|
||||
function premake.valac.getdefines(defines)
|
||||
local result = { }
|
||||
for _, def in ipairs(defines) do
|
||||
table.insert(result, '-D ' .. def)
|
||||
end
|
||||
return result
|
||||
end
|
||||
|
||||
|
||||
|
||||
--
|
||||
-- Decorate vapidirs for the Vala command line.
|
||||
--
|
||||
|
||||
function premake.valac.getvapidirs(vapidirs)
|
||||
local result = { }
|
||||
for _, def in ipairs(vapidirs) do
|
||||
table.insert(result, '--vapidir=' .. def)
|
||||
end
|
||||
return result
|
||||
end
|
||||
Reference in New Issue
Block a user