Refactored target building, fixed path separators for .NET projects
This commit is contained in:
parent
60bc689d3c
commit
e70595de03
@ -26,7 +26,6 @@
|
||||
newaction {
|
||||
trigger = "clean",
|
||||
description = "Remove all binaries and generated files",
|
||||
targetstyle = "windows",
|
||||
|
||||
execute = function()
|
||||
local solutions = { }
|
||||
@ -54,16 +53,17 @@
|
||||
table.insert(targets, path.join(rebase(cfg, cfg.buildtarget.directory), cfg.buildtarget.basename))
|
||||
|
||||
-- remove all possible permutations of the target binary
|
||||
os.remove(rebase(cfg, premake.gettarget(cfg, "build", "windows").fullpath))
|
||||
os.remove(rebase(cfg, premake.gettarget(cfg, "build", "linux", "linux").fullpath))
|
||||
os.remove(rebase(cfg, premake.gettarget(cfg, "build", "linux", "macosx").fullpath))
|
||||
os.remove(rebase(cfg, premake.gettarget(cfg, "build", "posix", "windows", "windows").fullpath))
|
||||
os.remove(rebase(cfg, premake.gettarget(cfg, "build", "posix", "posix", "linux").fullpath))
|
||||
os.remove(rebase(cfg, premake.gettarget(cfg, "build", "posix", "posix", "macosx").fullpath))
|
||||
os.remove(rebase(cfg, premake.gettarget(cfg, "build", "posix", "PS3", "windows").fullpath))
|
||||
if (cfg.kind == "WindowedApp") then
|
||||
os.rmdir(rebase(cfg, premake.gettarget(cfg, "build", "linux", "linux").fullpath .. ".app"))
|
||||
os.rmdir(rebase(cfg, premake.gettarget(cfg, "build", "posix", "posix", "linux").fullpath .. ".app"))
|
||||
end
|
||||
|
||||
-- if there is an import library, remove that too
|
||||
os.remove(rebase(cfg, premake.gettarget(cfg, "link", "windows").fullpath))
|
||||
os.remove(rebase(cfg, premake.gettarget(cfg, "link", "linux").fullpath))
|
||||
os.remove(rebase(cfg, premake.gettarget(cfg, "link", "windows", "windows", "windows").fullpath))
|
||||
os.remove(rebase(cfg, premake.gettarget(cfg, "link", "posix", "posix", "linux").fullpath))
|
||||
|
||||
os.rmdir(rebase(cfg, cfg.objectsdir))
|
||||
end
|
||||
|
@ -1,13 +1,13 @@
|
||||
--
|
||||
-- _codelite.lua
|
||||
-- Define the CodeLite action(s).
|
||||
-- Copyright (c) 2008 Jason Perkins and the Premake project
|
||||
-- Copyright (c) 2008-2009 Jason Perkins and the Premake project
|
||||
--
|
||||
|
||||
newaction {
|
||||
trigger = "codelite",
|
||||
shortname = "CodeLite",
|
||||
description = "CodeLite (experimental)",
|
||||
description = "CodeLite",
|
||||
|
||||
valid_kinds = { "ConsoleApp", "WindowedApp", "StaticLib", "SharedLib" },
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
--
|
||||
-- _make.lua
|
||||
-- Define the makefile action(s).
|
||||
-- Copyright (c) 2002-2008 Jason Perkins and the Premake project
|
||||
-- Copyright (c) 2002-2009 Jason Perkins and the Premake project
|
||||
--
|
||||
|
||||
_MAKE = { }
|
||||
@ -43,7 +43,6 @@
|
||||
_p('else')
|
||||
_p('\t$(SILENT) copy /Y $(subst /,\\\\,%s) $(subst /,\\\\,%s)', source, target)
|
||||
_p('endif')
|
||||
_p('')
|
||||
end
|
||||
|
||||
function premake.make_mkdirrule(var)
|
||||
|
@ -240,8 +240,8 @@
|
||||
premake.make_copyrule(source, target)
|
||||
end
|
||||
_p('endif')
|
||||
_p('')
|
||||
end
|
||||
_p('')
|
||||
|
||||
_p('# Copied file rules')
|
||||
for target, source in pairs(copypairs) do
|
||||
|
@ -1,7 +1,7 @@
|
||||
--
|
||||
-- _vstudio.lua
|
||||
-- Define the Visual Studio 200x actions.
|
||||
-- Copyright (c) 2008 Jason Perkins and the Premake project
|
||||
-- Copyright (c) 2008-2009 Jason Perkins and the Premake project
|
||||
--
|
||||
|
||||
_VS = { }
|
||||
@ -314,7 +314,7 @@
|
||||
trigger = "vs2002",
|
||||
shortname = "Visual Studio 2002",
|
||||
description = "Microsoft Visual Studio 2002",
|
||||
targetstyle = "windows",
|
||||
pathstyle = "windows",
|
||||
|
||||
valid_kinds = { "ConsoleApp", "WindowedApp", "StaticLib", "SharedLib" },
|
||||
|
||||
@ -342,7 +342,7 @@
|
||||
trigger = "vs2003",
|
||||
shortname = "Visual Studio 2003",
|
||||
description = "Microsoft Visual Studio 2003",
|
||||
targetstyle = "windows",
|
||||
pathstyle = "windows",
|
||||
|
||||
valid_kinds = { "ConsoleApp", "WindowedApp", "StaticLib", "SharedLib" },
|
||||
|
||||
@ -370,7 +370,7 @@
|
||||
trigger = "vs2005",
|
||||
shortname = "Visual Studio 2005",
|
||||
description = "Microsoft Visual Studio 2005 (SharpDevelop, MonoDevelop)",
|
||||
targetstyle = "windows",
|
||||
pathstyle = "windows",
|
||||
|
||||
valid_kinds = { "ConsoleApp", "WindowedApp", "StaticLib", "SharedLib" },
|
||||
|
||||
@ -398,7 +398,7 @@
|
||||
trigger = "vs2008",
|
||||
shortname = "Visual Studio 2008",
|
||||
description = "Microsoft Visual Studio 2008",
|
||||
targetstyle = "windows",
|
||||
pathstyle = "windows",
|
||||
|
||||
valid_kinds = { "ConsoleApp", "WindowedApp", "StaticLib", "SharedLib" },
|
||||
|
||||
|
@ -391,13 +391,14 @@
|
||||
for _, sln in ipairs(_SOLUTIONS) do
|
||||
for _, prj in ipairs(sln.projects) do
|
||||
for _, cfg in pairs(prj.__configs) do
|
||||
-- determine which conventions the target should follow for this config
|
||||
local pathstyle = premake.actions[_ACTION].pathstyle or "posix"
|
||||
local namestyle = premake.gettool(cfg).namestyle or "posix"
|
||||
|
||||
local targetstyle = premake.gettool(cfg).targetstyle
|
||||
|
||||
cfg.buildtarget = premake.gettarget(cfg, "build", targetstyle)
|
||||
cfg.linktarget = premake.gettarget(cfg, "link", targetstyle)
|
||||
|
||||
if (targetstyle == "windows") then
|
||||
-- build the targets
|
||||
cfg.buildtarget = premake.gettarget(cfg, "build", pathstyle, namestyle, cfg.system)
|
||||
cfg.linktarget = premake.gettarget(cfg, "link", pathstyle, namestyle, cfg.system)
|
||||
if pathstyle == "windows" then
|
||||
cfg.objectsdir = path.translate(cfg.objectsdir, "\\")
|
||||
end
|
||||
|
||||
|
@ -344,10 +344,15 @@
|
||||
-- The configuration to be targeted.
|
||||
-- @param direction
|
||||
-- One of 'build' for the build target, or 'link' for the linking target.
|
||||
-- @param tool
|
||||
-- The target toolset interface.
|
||||
-- @param pathstyle
|
||||
-- The path format, one of "windows" or "posix". This comes from the current
|
||||
-- action: Visual Studio uses "windows", GMake uses "posix", etc.
|
||||
-- @param namestyle
|
||||
-- The file naming style, one of "windows" or "posix". This comes from the
|
||||
-- current tool: GCC uses "posix", MSC uses "windows", etc.
|
||||
-- @param system
|
||||
-- The target operating system; if nil will use current OS settings.
|
||||
-- The target operating system, which can modify the naming style. For example,
|
||||
-- shared libraries on Mac OS X use a ".dylib" extension.
|
||||
-- @returns
|
||||
-- An object with these fields:
|
||||
-- basename - the target with no directory or file extension
|
||||
@ -356,36 +361,33 @@
|
||||
-- fullpath - directory, name, and extension
|
||||
--
|
||||
|
||||
function premake.gettarget(cfg, direction, style, system)
|
||||
if not system then system = cfg.system or os.get() end
|
||||
function premake.gettarget(cfg, direction, pathstyle, namestyle, system)
|
||||
if system == "bsd" then system = "linux" end
|
||||
|
||||
-- Fix things up based on the current system
|
||||
local kind = cfg.kind
|
||||
local decorations = premake.platforms[cfg.platform].targetstyle or style
|
||||
|
||||
if premake.iscppproject(cfg) then
|
||||
if system == "PS3" then
|
||||
namestyle = "PS3"
|
||||
elseif premake.iscppproject(cfg) then
|
||||
-- On Windows, shared libraries link against a static import library
|
||||
if (style == "windows" or system == "windows") and kind == "SharedLib" and direction == "link" then
|
||||
if (namestyle == "windows" or system == "windows") and kind == "SharedLib" and direction == "link" then
|
||||
kind = "StaticLib"
|
||||
end
|
||||
|
||||
-- Linux name conventions only apply to static libs on windows (by user request)
|
||||
if decorations == "linux" and system == "windows" and kind ~= "StaticLib" then
|
||||
decorations = "windows"
|
||||
|
||||
-- Posix name conventions only apply to static libs on windows (by user request)
|
||||
if namestyle == "posix" and system == "windows" and kind ~= "StaticLib" then
|
||||
namestyle = "windows"
|
||||
end
|
||||
else
|
||||
-- .NET always uses Windows naming conventions
|
||||
decorations = "windows"
|
||||
end
|
||||
|
||||
|
||||
-- Initialize the target components
|
||||
local field = iif(direction == "build", "target", "implib")
|
||||
local name = cfg[field.."name"] or cfg.targetname or cfg.project.name
|
||||
local dir = cfg[field.."dir"] or cfg.targetdir or path.getrelative(cfg.location, cfg.basedir)
|
||||
local prefix = ""
|
||||
local suffix = ""
|
||||
|
||||
if decorations == "windows" then
|
||||
|
||||
if namestyle == "windows" then
|
||||
if kind == "ConsoleApp" or kind == "WindowedApp" then
|
||||
suffix = ".exe"
|
||||
elseif kind == "SharedLib" then
|
||||
@ -393,7 +395,7 @@
|
||||
elseif kind == "StaticLib" then
|
||||
suffix = ".lib"
|
||||
end
|
||||
elseif decorations == "linux" then
|
||||
elseif namestyle == "posix" then
|
||||
if kind == "WindowedApp" and system == "macosx" then
|
||||
dir = path.join(dir, name .. ".app/Contents/MacOS")
|
||||
elseif kind == "SharedLib" then
|
||||
@ -403,7 +405,7 @@
|
||||
prefix = "lib"
|
||||
suffix = ".a"
|
||||
end
|
||||
elseif decorations == "ps3" then
|
||||
elseif namestyle == "PS3" then
|
||||
if kind == "ConsoleApp" or kind == "WindowedApp" then
|
||||
suffix = ".elf"
|
||||
elseif kind == "StaticLib" then
|
||||
@ -411,21 +413,22 @@
|
||||
suffix = ".a"
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
prefix = cfg[field.."prefix"] or cfg.targetprefix or prefix
|
||||
suffix = cfg[field.."extension"] or cfg.targetextension or suffix
|
||||
|
||||
-- build the results object
|
||||
local result = { }
|
||||
result.basename = name
|
||||
result.name = prefix .. name .. suffix
|
||||
result.directory = dir
|
||||
result.fullpath = path.join(result.directory, result.name)
|
||||
|
||||
if style == "windows" then
|
||||
if pathstyle == "windows" then
|
||||
result.directory = path.translate(result.directory, "\\")
|
||||
result.fullpath = path.translate(result.fullpath, "\\")
|
||||
end
|
||||
|
||||
|
||||
return result
|
||||
end
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
--
|
||||
-- dotnet.lua
|
||||
-- Interface for the C# compilers, all of which are flag compatible.
|
||||
-- Copyright (c) 2002-2008 Jason Perkins and the Premake project
|
||||
-- Copyright (c) 2002-2009 Jason Perkins and the Premake project
|
||||
--
|
||||
|
||||
|
||||
premake.dotnet = { }
|
||||
premake.dotnet.targetstyle = "windows"
|
||||
premake.dotnet.namestyle = "windows"
|
||||
|
||||
|
||||
--
|
||||
|
@ -6,7 +6,6 @@
|
||||
|
||||
|
||||
premake.gcc = { }
|
||||
premake.gcc.targetstyle = "linux"
|
||||
|
||||
|
||||
--
|
||||
@ -132,7 +131,7 @@
|
||||
end
|
||||
|
||||
if cfg.system == "windows" and not cfg.flags.NoImportLib then
|
||||
table.insert(result, '-Wl,--out-implib="'..premake.gettarget(cfg, "link", "linux", "windows").fullpath..'"')
|
||||
table.insert(result, '-Wl,--out-implib="' .. cfg.linktarget.fullpath .. '"')
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -6,4 +6,4 @@
|
||||
|
||||
|
||||
premake.msc = { }
|
||||
premake.msc.targetstyle = "windows"
|
||||
premake.msc.namestyle = "windows"
|
||||
|
@ -5,7 +5,7 @@
|
||||
--
|
||||
|
||||
premake.ow = { }
|
||||
premake.ow.targetstyle = "windows"
|
||||
premake.ow.namestyle = "windows"
|
||||
|
||||
|
||||
--
|
||||
|
@ -18,6 +18,7 @@
|
||||
cfg.platform = "Native"
|
||||
cfg.links = { }
|
||||
cfg.libdirs = { }
|
||||
cfg.linktarget = { fullpath="libMyProject.a" }
|
||||
end
|
||||
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
--
|
||||
-- tests/test_targets.lua
|
||||
-- Automated test suite for premake.gettarget()
|
||||
-- Copyright (c) 2008 Jason Perkins and the Premake project
|
||||
-- Copyright (c) 2008, 2009 Jason Perkins and the Premake project
|
||||
--
|
||||
|
||||
T.targets = { }
|
||||
@ -21,372 +21,215 @@
|
||||
|
||||
|
||||
--
|
||||
-- Windows/C++/ConsoleApp tests
|
||||
-- Path Style Name Style Example Environment
|
||||
-- ---------- ---------- -------------------
|
||||
-- windows windows VStudio with MSC
|
||||
-- posix posix GMake with GCC
|
||||
-- windows posix VStudio for PS3
|
||||
-- posix windows GMake for .NET
|
||||
--
|
||||
|
||||
function T.targets.ConsoleApp_Windows_Build_Windows()
|
||||
|
||||
|
||||
|
||||
--
|
||||
-- ConsoleApp tests
|
||||
--
|
||||
|
||||
function T.targets.ConsoleApp_Build_WindowsNames()
|
||||
cfg.kind = "ConsoleApp"
|
||||
result = premake.gettarget(cfg, "build", "windows", "windows")
|
||||
test.isequal([[..\bin\MyProject.exe]], result.fullpath)
|
||||
end
|
||||
|
||||
function T.targets.ConsoleApp_Windows_Build_Linux()
|
||||
cfg.kind = "ConsoleApp"
|
||||
result = premake.gettarget(cfg, "build", "windows", "linux")
|
||||
test.isequal([[..\bin\MyProject.exe]], result.fullpath)
|
||||
end
|
||||
|
||||
function T.targets.ConsoleApp_Windows_Build_MacOSX()
|
||||
cfg.kind = "ConsoleApp"
|
||||
result = premake.gettarget(cfg, "build", "windows", "macosx")
|
||||
test.isequal([[..\bin\MyProject.exe]], result.fullpath)
|
||||
end
|
||||
|
||||
function T.targets.ConsoleApp_Windows_Build_PS3()
|
||||
cfg.kind = "ConsoleApp"
|
||||
cfg.platform = "PS3"
|
||||
result = premake.gettarget(cfg, "build", "windows", "windows")
|
||||
test.isequal([[..\bin\MyProject.elf]], result.fullpath)
|
||||
end
|
||||
|
||||
function T.targets.ConsoleApp_Windows_Build_Xbox360()
|
||||
cfg.kind = "ConsoleApp"
|
||||
cfg.platform = "Xbox360"
|
||||
result = premake.gettarget(cfg, "build", "windows", "windows")
|
||||
test.isequal([[..\bin\MyProject.exe]], result.fullpath)
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- Windows/C++/WindowedApp tests
|
||||
--
|
||||
|
||||
function T.targets.WindowedApp_Windows_Build_Windows()
|
||||
cfg.kind = "WindowedApp"
|
||||
result = premake.gettarget(cfg, "build", "windows", "windows")
|
||||
test.isequal([[..\bin\MyProject.exe]], result.fullpath)
|
||||
end
|
||||
|
||||
function T.targets.WindowedApp_Windows_Build_Linux()
|
||||
cfg.kind = "WindowedApp"
|
||||
result = premake.gettarget(cfg, "build", "windows", "linux")
|
||||
test.isequal([[..\bin\MyProject.exe]], result.fullpath)
|
||||
end
|
||||
|
||||
function T.targets.WindowedApp_Windows_Build_MacOSX()
|
||||
cfg.kind = "WindowedApp"
|
||||
result = premake.gettarget(cfg, "build", "windows", "macosx")
|
||||
test.isequal([[..\bin\MyProject.exe]], result.fullpath)
|
||||
end
|
||||
|
||||
function T.targets.WindowedApp_Windows_Build_PS3()
|
||||
cfg.kind = "WindowedApp"
|
||||
cfg.platform = "PS3"
|
||||
result = premake.gettarget(cfg, "build", "windows", "windows")
|
||||
test.isequal([[..\bin\MyProject.elf]], result.fullpath)
|
||||
end
|
||||
|
||||
function T.targets.WindowedApp_Windows_Build_Xbox360()
|
||||
cfg.kind = "WindowedApp"
|
||||
cfg.platform = "Xbox360"
|
||||
result = premake.gettarget(cfg, "build", "windows", "windows")
|
||||
test.isequal([[..\bin\MyProject.exe]], result.fullpath)
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- Windows/C++/SharedLib tests
|
||||
--
|
||||
|
||||
function T.targets.SharedLib_Windows_Build_Windows()
|
||||
cfg.kind = "SharedLib"
|
||||
result = premake.gettarget(cfg, "build", "windows", "windows")
|
||||
test.isequal([[..\bin\MyProject.dll]], result.fullpath)
|
||||
end
|
||||
|
||||
function T.targets.SharedLib_Windows_Build_Linux()
|
||||
cfg.kind = "SharedLib"
|
||||
result = premake.gettarget(cfg, "build", "windows", "linux")
|
||||
test.isequal([[..\bin\MyProject.dll]], result.fullpath)
|
||||
end
|
||||
|
||||
function T.targets.SharedLib_Windows_Build_MacOSX()
|
||||
cfg.kind = "SharedLib"
|
||||
result = premake.gettarget(cfg, "build", "windows", "macosx")
|
||||
test.isequal([[..\bin\MyProject.dll]], result.fullpath)
|
||||
end
|
||||
|
||||
function T.targets.SharedLib_Windows_Build_Xbox360()
|
||||
cfg.kind = "SharedLib"
|
||||
cfg.platform = "Xbox360"
|
||||
result = premake.gettarget(cfg, "build", "windows", "linux")
|
||||
test.isequal([[..\bin\MyProject.dll]], result.fullpath)
|
||||
end
|
||||
|
||||
function T.targets.SharedLib_Windows_Link_Windows()
|
||||
cfg.kind = "SharedLib"
|
||||
result = premake.gettarget(cfg, "link", "windows", "windows")
|
||||
test.isequal([[..\bin\MyProject.lib]], result.fullpath)
|
||||
end
|
||||
|
||||
function T.targets.SharedLib_Windows_Link_Linux()
|
||||
cfg.kind = "SharedLib"
|
||||
result = premake.gettarget(cfg, "link", "windows", "linux")
|
||||
test.isequal([[..\bin\MyProject.lib]], result.fullpath)
|
||||
end
|
||||
|
||||
function T.targets.SharedLib_Windows_Link_MacOSX()
|
||||
cfg.kind = "SharedLib"
|
||||
result = premake.gettarget(cfg, "link", "windows", "macosx")
|
||||
test.isequal([[..\bin\MyProject.lib]], result.fullpath)
|
||||
end
|
||||
|
||||
function T.targets.SharedLib_Windows_Link_Xbox360()
|
||||
cfg.kind = "SharedLib"
|
||||
cfg.platform = "Xbox360"
|
||||
result = premake.gettarget(cfg, "link", "windows", "macosx")
|
||||
test.isequal([[..\bin\MyProject.lib]], result.fullpath)
|
||||
end
|
||||
|
||||
|
||||
|
||||
--
|
||||
-- Windows/C++/StaticLib tests
|
||||
--
|
||||
|
||||
function T.targets.StaticLib_Windows_Build_Windows()
|
||||
cfg.kind = "StaticLib"
|
||||
result = premake.gettarget(cfg, "build", "windows", "windows")
|
||||
test.isequal([[..\bin\MyProject.lib]], result.fullpath)
|
||||
end
|
||||
|
||||
function T.targets.StaticLib_Windows_Build_Linux()
|
||||
cfg.kind = "StaticLib"
|
||||
result = premake.gettarget(cfg, "build", "windows", "linux")
|
||||
test.isequal([[..\bin\MyProject.lib]], result.fullpath)
|
||||
end
|
||||
|
||||
function T.targets.StaticLib_Windows_Build_MacOSX()
|
||||
cfg.kind = "StaticLib"
|
||||
result = premake.gettarget(cfg, "build", "windows", "macosx")
|
||||
test.isequal([[..\bin\MyProject.lib]], result.fullpath)
|
||||
end
|
||||
|
||||
function T.targets.StaticLib_Windows_Build_PS3()
|
||||
cfg.kind = "StaticLib"
|
||||
cfg.platform = "PS3"
|
||||
result = premake.gettarget(cfg, "build", "windows", "macosx")
|
||||
test.isequal([[..\bin\libMyProject.a]], result.fullpath)
|
||||
end
|
||||
|
||||
function T.targets.StaticLib_Windows_Build_Xbox360()
|
||||
cfg.kind = "StaticLib"
|
||||
cfg.platform = "Xbox360"
|
||||
result = premake.gettarget(cfg, "build", "windows", "macosx")
|
||||
test.isequal([[..\bin\MyProject.lib]], result.fullpath)
|
||||
end
|
||||
|
||||
function T.targets.StaticLib_Windows_Link_Windows()
|
||||
cfg.kind = "StaticLib"
|
||||
result = premake.gettarget(cfg, "link", "windows", "windows")
|
||||
test.isequal([[..\bin\MyProject.lib]], result.fullpath)
|
||||
end
|
||||
|
||||
function T.targets.StaticLib_Windows_Link_Linux()
|
||||
cfg.kind = "StaticLib"
|
||||
result = premake.gettarget(cfg, "link", "windows", "linux")
|
||||
test.isequal([[..\bin\MyProject.lib]], result.fullpath)
|
||||
end
|
||||
|
||||
function T.targets.StaticLib_Windows_Link_MacOSX()
|
||||
cfg.kind = "StaticLib"
|
||||
result = premake.gettarget(cfg, "link", "windows", "macosx")
|
||||
test.isequal([[..\bin\MyProject.lib]], result.fullpath)
|
||||
end
|
||||
|
||||
function T.targets.StaticLib_Windows_Link_PS3()
|
||||
cfg.kind = "StaticLib"
|
||||
cfg.platform = "PS3"
|
||||
result = premake.gettarget(cfg, "link", "windows", "windows")
|
||||
test.isequal([[..\bin\libMyProject.a]], result.fullpath)
|
||||
end
|
||||
|
||||
function T.targets.StaticLib_Windows_Link_Xbox360()
|
||||
cfg.kind = "StaticLib"
|
||||
cfg.platform = "Xbox360"
|
||||
result = premake.gettarget(cfg, "link", "windows", "windows")
|
||||
test.isequal([[..\bin\MyProject.lib]], result.fullpath)
|
||||
end
|
||||
|
||||
|
||||
|
||||
--
|
||||
-- Linux/C++/ConsoleApp tests
|
||||
--
|
||||
|
||||
function T.targets.ConsoleApp_Linux_Build_Windows()
|
||||
cfg.kind = "ConsoleApp"
|
||||
result = premake.gettarget(cfg, "build", "linux", "windows")
|
||||
result = premake.gettarget(cfg, "build", "posix", "windows", "macosx")
|
||||
test.isequal([[../bin/MyProject.exe]], result.fullpath)
|
||||
end
|
||||
|
||||
function T.targets.ConsoleApp_Linux_Build_Linux()
|
||||
cfg.kind = "ConsoleApp"
|
||||
result = premake.gettarget(cfg, "build", "linux", "linux")
|
||||
test.isequal([[../bin/MyProject]], result.fullpath)
|
||||
end
|
||||
|
||||
function T.targets.ConsoleApp_Linux_Build_MacOSX()
|
||||
cfg.kind = "ConsoleApp"
|
||||
result = premake.gettarget(cfg, "build", "linux", "macosx")
|
||||
test.isequal([[../bin/MyProject]], result.fullpath)
|
||||
end
|
||||
|
||||
function T.targets.ConsoleApp_Linux_Build_PS3()
|
||||
function T.targets.ConsoleApp_Build_PosixNames_OnWindows()
|
||||
cfg.kind = "ConsoleApp"
|
||||
cfg.platform = "PS3"
|
||||
result = premake.gettarget(cfg, "build", "linux", "linux")
|
||||
result = premake.gettarget(cfg, "build", "posix", "posix", "windows")
|
||||
test.isequal([[../bin/MyProject.exe]], result.fullpath)
|
||||
end
|
||||
|
||||
function T.targets.ConsoleApp_Build_PosixNames_OnLinux()
|
||||
cfg.kind = "ConsoleApp"
|
||||
result = premake.gettarget(cfg, "build", "posix", "posix", "linux")
|
||||
test.isequal([[../bin/MyProject]], result.fullpath)
|
||||
end
|
||||
|
||||
function T.targets.ConsoleApp_Build_PosixNames_OnMacOSX()
|
||||
cfg.kind = "ConsoleApp"
|
||||
result = premake.gettarget(cfg, "build", "posix", "posix", "macosx")
|
||||
test.isequal([[../bin/MyProject]], result.fullpath)
|
||||
end
|
||||
|
||||
function T.targets.ConsoleApp_Build_PS3Names()
|
||||
cfg.kind = "ConsoleApp"
|
||||
result = premake.gettarget(cfg, "build", "posix", "PS3", "macosx")
|
||||
test.isequal([[../bin/MyProject.elf]], result.fullpath)
|
||||
end
|
||||
|
||||
function T.targets.ConsoleApp_Linux_Build_Xbox360()
|
||||
cfg.kind = "ConsoleApp"
|
||||
cfg.platform = "Xbox360"
|
||||
result = premake.gettarget(cfg, "build", "linux", "linux")
|
||||
test.isequal([[../bin/MyProject.exe]], result.fullpath)
|
||||
end
|
||||
|
||||
|
||||
|
||||
--
|
||||
-- Linux/C++/WindowedApp tests
|
||||
-- WindowedApp tests
|
||||
--
|
||||
|
||||
function T.targets.WindowedApp_Linux_Build_Windows()
|
||||
cfg.kind = "WindowedApp"
|
||||
result = premake.gettarget(cfg, "build", "linux", "windows")
|
||||
function T.targets.WindowedApp_Build_WindowsNames()
|
||||
cfg.kind = "WindowedApp"
|
||||
result = premake.gettarget(cfg, "build", "posix", "windows", "macosx")
|
||||
test.isequal([[../bin/MyProject.exe]], result.fullpath)
|
||||
end
|
||||
|
||||
function T.targets.WindowedApp_Linux_Build_Linux()
|
||||
cfg.kind = "WindowedApp"
|
||||
result = premake.gettarget(cfg, "build", "linux", "linux")
|
||||
function T.targets.WindowedApp_Build_PosixNames_OnWindows()
|
||||
cfg.kind = "WindowedApp"
|
||||
result = premake.gettarget(cfg, "build", "posix", "posix", "windows")
|
||||
test.isequal([[../bin/MyProject.exe]], result.fullpath)
|
||||
end
|
||||
|
||||
function T.targets.WindowedApp_Build_PosixNames_OnLinux()
|
||||
cfg.kind = "WindowedApp"
|
||||
result = premake.gettarget(cfg, "build", "posix", "posix", "linux")
|
||||
test.isequal([[../bin/MyProject]], result.fullpath)
|
||||
end
|
||||
|
||||
function T.targets.WindowedApp_Linux_Build_MacOSX()
|
||||
cfg.kind = "WindowedApp"
|
||||
result = premake.gettarget(cfg, "build", "linux", "macosx")
|
||||
function T.targets.WindowedApp_Build_PosixNames_OnMacOSX()
|
||||
cfg.kind = "WindowedApp"
|
||||
result = premake.gettarget(cfg, "build", "posix", "posix", "macosx")
|
||||
test.isequal([[../bin/MyProject.app/Contents/MacOS/MyProject]], result.fullpath)
|
||||
end
|
||||
|
||||
function T.targets.WindowedApp_Linux_Build_PS3()
|
||||
|
||||
function T.targets.WindowedApp_Build_PS3Names()
|
||||
cfg.kind = "WindowedApp"
|
||||
cfg.platform = "PS3"
|
||||
result = premake.gettarget(cfg, "build", "linux", "linux")
|
||||
result = premake.gettarget(cfg, "build", "posix", "PS3", "macosx")
|
||||
test.isequal([[../bin/MyProject.elf]], result.fullpath)
|
||||
end
|
||||
|
||||
function T.targets.WindowedApp_Linux_Build_Xbox360()
|
||||
cfg.kind = "WindowedApp"
|
||||
cfg.platform = "Xbox360"
|
||||
result = premake.gettarget(cfg, "build", "linux", "linux")
|
||||
test.isequal([[../bin/MyProject.exe]], result.fullpath)
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- Linux/C++/SharedLib tests
|
||||
-- SharedLib tests
|
||||
--
|
||||
|
||||
function T.targets.SharedLib_Linux_Build_Windows()
|
||||
function T.targets.SharedLib_Build_WindowsNames()
|
||||
cfg.kind = "SharedLib"
|
||||
result = premake.gettarget(cfg, "build", "linux", "windows")
|
||||
result = premake.gettarget(cfg, "build", "posix", "windows", "macosx")
|
||||
test.isequal([[../bin/MyProject.dll]], result.fullpath)
|
||||
end
|
||||
|
||||
function T.targets.SharedLib_Linux_Build_Linux()
|
||||
function T.targets.SharedLib_Link_WindowsNames()
|
||||
cfg.kind = "SharedLib"
|
||||
result = premake.gettarget(cfg, "build", "linux", "linux")
|
||||
result = premake.gettarget(cfg, "link", "posix", "windows", "macosx")
|
||||
test.isequal([[../bin/MyProject.lib]], result.fullpath)
|
||||
end
|
||||
|
||||
function T.targets.SharedLib_Build_PosixNames_OnWindows()
|
||||
cfg.kind = "SharedLib"
|
||||
result = premake.gettarget(cfg, "build", "posix", "posix", "windows")
|
||||
test.isequal([[../bin/MyProject.dll]], result.fullpath)
|
||||
end
|
||||
|
||||
function T.targets.SharedLib_Link_PosixNames_OnWindows()
|
||||
cfg.kind = "SharedLib"
|
||||
result = premake.gettarget(cfg, "link", "posix", "posix", "windows")
|
||||
test.isequal([[../bin/libMyProject.a]], result.fullpath)
|
||||
end
|
||||
|
||||
function T.targets.SharedLib_Build_PosixNames_OnLinux()
|
||||
cfg.kind = "SharedLib"
|
||||
result = premake.gettarget(cfg, "build", "posix", "posix", "linux")
|
||||
test.isequal([[../bin/libMyProject.so]], result.fullpath)
|
||||
end
|
||||
|
||||
function T.targets.SharedLib_Linux_Build_MacOSX()
|
||||
function T.targets.SharedLib_Link_PosixNames_OnLinux()
|
||||
cfg.kind = "SharedLib"
|
||||
result = premake.gettarget(cfg, "build", "linux", "macosx")
|
||||
test.isequal([[../bin/libMyProject.dylib]], result.fullpath)
|
||||
end
|
||||
|
||||
function T.targets.SharedLib_Linux_Link_Windows()
|
||||
cfg.kind = "SharedLib"
|
||||
result = premake.gettarget(cfg, "link", "linux", "windows")
|
||||
test.isequal([[../bin/libMyProject.a]], result.fullpath)
|
||||
end
|
||||
|
||||
function T.targets.SharedLib_Linux_Link_Linux()
|
||||
cfg.kind = "SharedLib"
|
||||
result = premake.gettarget(cfg, "link", "linux", "linux")
|
||||
result = premake.gettarget(cfg, "link", "posix", "posix", "linux")
|
||||
test.isequal([[../bin/libMyProject.so]], result.fullpath)
|
||||
end
|
||||
|
||||
function T.targets.SharedLib_Linux_Link_MacOSX()
|
||||
function T.targets.SharedLib_Build_PosixNames_OnMacOSX()
|
||||
cfg.kind = "SharedLib"
|
||||
result = premake.gettarget(cfg, "link", "linux", "macosx")
|
||||
result = premake.gettarget(cfg, "build", "posix", "posix", "macosx")
|
||||
test.isequal([[../bin/libMyProject.dylib]], result.fullpath)
|
||||
end
|
||||
|
||||
|
||||
function T.targets.SharedLib_Link_PosixNames_OnMacOSX()
|
||||
cfg.kind = "SharedLib"
|
||||
result = premake.gettarget(cfg, "link", "posix", "posix", "macosx")
|
||||
test.isequal([[../bin/libMyProject.dylib]], result.fullpath)
|
||||
end
|
||||
|
||||
|
||||
|
||||
--
|
||||
-- Linux/C++/StaticLib tests
|
||||
-- StaticLib tests
|
||||
--
|
||||
|
||||
function T.targets.StaticLib_Linux_Build_Windows()
|
||||
function T.targets.StaticLib_Build_WindowsNames()
|
||||
cfg.kind = "StaticLib"
|
||||
result = premake.gettarget(cfg, "build", "linux", "windows")
|
||||
result = premake.gettarget(cfg, "build", "posix", "windows", "macosx")
|
||||
test.isequal([[../bin/MyProject.lib]], result.fullpath)
|
||||
end
|
||||
|
||||
function T.targets.StaticLib_Link_WindowsNames()
|
||||
cfg.kind = "StaticLib"
|
||||
result = premake.gettarget(cfg, "link", "posix", "windows", "macosx")
|
||||
test.isequal([[../bin/MyProject.lib]], result.fullpath)
|
||||
end
|
||||
|
||||
function T.targets.StaticLib_Build_PosixNames_OnWindows()
|
||||
cfg.kind = "StaticLib"
|
||||
result = premake.gettarget(cfg, "build", "posix", "posix", "windows")
|
||||
test.isequal([[../bin/libMyProject.a]], result.fullpath)
|
||||
end
|
||||
|
||||
function T.targets.StaticLib_Linux_Build_Linux()
|
||||
function T.targets.StaticLib_Link_PosixNames_OnWindows()
|
||||
cfg.kind = "StaticLib"
|
||||
result = premake.gettarget(cfg, "build", "linux", "linux")
|
||||
result = premake.gettarget(cfg, "link", "posix", "posix", "windows")
|
||||
test.isequal([[../bin/libMyProject.a]], result.fullpath)
|
||||
end
|
||||
|
||||
function T.targets.StaticLib_Linux_Build_MacOSX()
|
||||
function T.targets.StaticLib_Build_PosixNames_OnLinux()
|
||||
cfg.kind = "StaticLib"
|
||||
result = premake.gettarget(cfg, "build", "linux", "macosx")
|
||||
result = premake.gettarget(cfg, "build", "posix", "posix", "linux")
|
||||
test.isequal([[../bin/libMyProject.a]], result.fullpath)
|
||||
end
|
||||
|
||||
function T.targets.StaticLib_Linux_Build_PS3()
|
||||
function T.targets.StaticLib_Link_PosixNames_OnLinux()
|
||||
cfg.kind = "StaticLib"
|
||||
cfg.platform = "PS3"
|
||||
result = premake.gettarget(cfg, "build", "linux", "macosx")
|
||||
result = premake.gettarget(cfg, "link", "posix", "posix", "linux")
|
||||
test.isequal([[../bin/libMyProject.a]], result.fullpath)
|
||||
end
|
||||
|
||||
function T.targets.StaticLib_Linux_Link_Windows()
|
||||
function T.targets.StaticLib_Build_PosixNames_OnMacOSX()
|
||||
cfg.kind = "StaticLib"
|
||||
result = premake.gettarget(cfg, "link", "linux", "windows")
|
||||
result = premake.gettarget(cfg, "build", "posix", "posix", "macosx")
|
||||
test.isequal([[../bin/libMyProject.a]], result.fullpath)
|
||||
end
|
||||
|
||||
function T.targets.StaticLib_Linux_Link_Linux()
|
||||
function T.targets.StaticLib_Link_PosixNames_OnMacOSX()
|
||||
cfg.kind = "StaticLib"
|
||||
result = premake.gettarget(cfg, "link", "linux", "linux")
|
||||
result = premake.gettarget(cfg, "link", "posix", "posix", "macosx")
|
||||
test.isequal([[../bin/libMyProject.a]], result.fullpath)
|
||||
end
|
||||
|
||||
function T.targets.StaticLib_Linux_Link_MacOSX()
|
||||
function T.targets.StaticLib_Build_PosixNames_OnPS3()
|
||||
cfg.kind = "StaticLib"
|
||||
result = premake.gettarget(cfg, "link", "linux", "macosx")
|
||||
result = premake.gettarget(cfg, "build", "posix", "PS3", "macosx")
|
||||
test.isequal([[../bin/libMyProject.a]], result.fullpath)
|
||||
end
|
||||
|
||||
function T.targets.StaticLib_Linux_Link_PS3()
|
||||
function T.targets.StaticLib_Link_PosixNames_OnPS3()
|
||||
cfg.kind = "StaticLib"
|
||||
cfg.platform = "PS3"
|
||||
result = premake.gettarget(cfg, "link", "linux", "macosx")
|
||||
result = premake.gettarget(cfg, "link", "posix", "PS3", "macosx")
|
||||
test.isequal([[../bin/libMyProject.a]], result.fullpath)
|
||||
end
|
||||
|
||||
|
||||
|
||||
--
|
||||
-- Windows path tests
|
||||
--
|
||||
|
||||
function T.targets.WindowsPaths()
|
||||
cfg.kind = "ConsoleApp"
|
||||
result = premake.gettarget(cfg, "build", "windows", "windows", "linux")
|
||||
test.isequal([[..\bin]], result.directory)
|
||||
test.isequal([[..\bin\MyProject.exe]], result.fullpath)
|
||||
end
|
Loading…
Reference in New Issue
Block a user