Merge pull request #758 from LORgames/ssurtees/whitespaceCleanup
Cleaned up inconsistencies in whitespace
This commit is contained in:
commit
6cc2514737
@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
valid_kinds = { "ConsoleApp", "WindowedApp", "Makefile", "SharedLib", "StaticLib", "Utility" },
|
valid_kinds = { "ConsoleApp", "WindowedApp", "Makefile", "SharedLib", "StaticLib", "Utility" },
|
||||||
valid_tools = {
|
valid_tools = {
|
||||||
cc = { "gcc", "clang", "msc" }
|
cc = { "gcc", "clang", "msc" }
|
||||||
},
|
},
|
||||||
supports_language = function(lang)
|
supports_language = function(lang)
|
||||||
return p.languages.isc(lang) or
|
return p.languages.isc(lang) or
|
||||||
|
@ -159,8 +159,8 @@
|
|||||||
_p('\t@echo $(notdir $<)')
|
_p('\t@echo $(notdir $<)')
|
||||||
_p('\t$(SILENT) $(DC) $(ALL_DFLAGS) $(OUTPUTFLAG) -c $<')
|
_p('\t$(SILENT) $(DC) $(ALL_DFLAGS) $(OUTPUTFLAG) -c $<')
|
||||||
else
|
else
|
||||||
oldfn(prj, node)
|
oldfn(prj, node)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
local p = premake
|
local p = premake
|
||||||
local project = p.project
|
local project = p.project
|
||||||
local config = p.config
|
local config = p.config
|
||||||
local d = p.modules.d
|
local d = p.modules.d
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Set default tools
|
-- Set default tools
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
local gdc = p.tools.gdc
|
local gdc = p.tools.gdc
|
||||||
local project = p.project
|
local project = p.project
|
||||||
local config = p.config
|
local config = p.config
|
||||||
local d = p.modules.d
|
local d = p.modules.d
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Set default tools
|
-- Set default tools
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
local ldc = p.tools.ldc
|
local ldc = p.tools.ldc
|
||||||
local project = p.project
|
local project = p.project
|
||||||
local config = p.config
|
local config = p.config
|
||||||
local d = p.modules.d
|
local d = p.modules.d
|
||||||
|
|
||||||
|
|
||||||
--
|
--
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
newaction
|
newaction
|
||||||
{
|
{
|
||||||
trigger = "raw",
|
trigger = "raw",
|
||||||
shortname = "Raw output",
|
shortname = "Raw output",
|
||||||
description = "Generate raw representation of Premake structures",
|
description = "Generate raw representation of Premake structures",
|
||||||
|
|
||||||
onsolution = function(sln)
|
onsolution = function(sln)
|
||||||
require('raw')
|
require('raw')
|
||||||
|
|
||||||
premake.generate(sln, ".raw", premake.raw.solution)
|
premake.generate(sln, ".raw", premake.raw.solution)
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|
||||||
return function(cfg)
|
return function(cfg)
|
||||||
|
@ -4,73 +4,73 @@ local raw = p.raw
|
|||||||
local gvisited = { }
|
local gvisited = { }
|
||||||
|
|
||||||
function raw.solution(sln)
|
function raw.solution(sln)
|
||||||
if not gvisited[sln.global] then
|
if not gvisited[sln.global] then
|
||||||
gvisited[sln.global] = true
|
gvisited[sln.global] = true
|
||||||
raw.printTable({ global = sln.global })
|
raw.printTable({ global = sln.global })
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function raw.printTable(t, i)
|
function raw.printTable(t, i)
|
||||||
i = i or 0
|
i = i or 0
|
||||||
placement = raw._createPlacement(t)
|
placement = raw._createPlacement(t)
|
||||||
raw._printTableRecursive(t, i, placement)
|
raw._printTableRecursive(t, i, placement)
|
||||||
end
|
end
|
||||||
|
|
||||||
function raw._printTableRecursive(t, i, placement)
|
function raw._printTableRecursive(t, i, placement)
|
||||||
elements = { }
|
elements = { }
|
||||||
for k, v in pairs(t) do
|
for k, v in pairs(t) do
|
||||||
table.insert(elements, { key = k, value = v })
|
table.insert(elements, { key = k, value = v })
|
||||||
end
|
end
|
||||||
|
|
||||||
table.sort(elements, function(a, b)
|
table.sort(elements, function(a, b)
|
||||||
local n1 = type(a.key) == "number"
|
local n1 = type(a.key) == "number"
|
||||||
local n2 = type(b.key) == "number"
|
local n2 = type(b.key) == "number"
|
||||||
if n1 ~= n2 then
|
if n1 ~= n2 then
|
||||||
return n1
|
return n1
|
||||||
end
|
end
|
||||||
|
|
||||||
local k1 = n1 and a.key or raw._encode(a.key)
|
local k1 = n1 and a.key or raw._encode(a.key)
|
||||||
local k2 = n2 and b.key or raw._encode(b.key)
|
local k2 = n2 and b.key or raw._encode(b.key)
|
||||||
return k1 < k2
|
return k1 < k2
|
||||||
end)
|
end)
|
||||||
|
|
||||||
for _, elem in ipairs(elements) do
|
for _, elem in ipairs(elements) do
|
||||||
p = placement[elem.value]
|
p = placement[elem.value]
|
||||||
if p and elem.key == p.key and t == p.parent then
|
if p and elem.key == p.key and t == p.parent then
|
||||||
_p(i, "%s", raw._encode(elem.key) .. ': ' .. raw._encode(elem.value) .. ' {')
|
_p(i, "%s", raw._encode(elem.key) .. ': ' .. raw._encode(elem.value) .. ' {')
|
||||||
raw._printTableRecursive(elem.value, i + 1, placement)
|
raw._printTableRecursive(elem.value, i + 1, placement)
|
||||||
_p(i, '} # ' .. raw._encode(elem.key))
|
_p(i, '} # ' .. raw._encode(elem.key))
|
||||||
else
|
else
|
||||||
_p(i, "%s", raw._encode(elem.key) .. ': ' .. raw._encode(elem.value))
|
_p(i, "%s", raw._encode(elem.key) .. ': ' .. raw._encode(elem.value))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function raw._createPlacement(tbl)
|
function raw._createPlacement(tbl)
|
||||||
placement = { }
|
placement = { }
|
||||||
placementList = { tbl }
|
placementList = { tbl }
|
||||||
while #placementList ~= 0 do
|
while #placementList ~= 0 do
|
||||||
parentList = { }
|
parentList = { }
|
||||||
for _, parent in ipairs(placementList) do
|
for _, parent in ipairs(placementList) do
|
||||||
for k, v in pairs(parent) do
|
for k, v in pairs(parent) do
|
||||||
if type(v) == "table" and not placement[v] then
|
if type(v) == "table" and not placement[v] then
|
||||||
table.insert(parentList, v)
|
table.insert(parentList, v)
|
||||||
placement[v] = {
|
placement[v] = {
|
||||||
parent = parent,
|
parent = parent,
|
||||||
key = k
|
key = k
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
placementList = parentList
|
placementList = parentList
|
||||||
end
|
end
|
||||||
return placement
|
return placement
|
||||||
end
|
end
|
||||||
|
|
||||||
function raw._encode(v)
|
function raw._encode(v)
|
||||||
if type(v) == "string" then
|
if type(v) == "string" then
|
||||||
return '"' .. v .. '"'
|
return '"' .. v .. '"'
|
||||||
else
|
else
|
||||||
return tostring(v)
|
return tostring(v)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -7,9 +7,9 @@
|
|||||||
local p = premake
|
local p = premake
|
||||||
local xcode = p.modules.xcode
|
local xcode = p.modules.xcode
|
||||||
local tree = p.tree
|
local tree = p.tree
|
||||||
local workspace = p.workspace
|
local workspace = p.workspace
|
||||||
local project = p.project
|
local project = p.project
|
||||||
local config = p.config
|
local config = p.config
|
||||||
local fileconfig = p.fileconfig
|
local fileconfig = p.fileconfig
|
||||||
|
|
||||||
|
|
||||||
|
@ -39,33 +39,33 @@
|
|||||||
table.insert(tr.configs, cfg)
|
table.insert(tr.configs, cfg)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- convert localized resources from their filesystem layout (English.lproj/MainMenu.xib)
|
-- convert localized resources from their filesystem layout (English.lproj/MainMenu.xib)
|
||||||
-- to Xcode's display layout (MainMenu.xib/English).
|
-- to Xcode's display layout (MainMenu.xib/English).
|
||||||
tree.traverse(tr, {
|
tree.traverse(tr, {
|
||||||
onbranch = function(node)
|
onbranch = function(node)
|
||||||
if path.getextension(node.name) == ".lproj" then
|
if path.getextension(node.name) == ".lproj" then
|
||||||
local lang = path.getbasename(node.name) -- "English", "French", etc.
|
local lang = path.getbasename(node.name) -- "English", "French", etc.
|
||||||
|
|
||||||
-- create a new language group for each file it contains
|
-- create a new language group for each file it contains
|
||||||
for _, filenode in ipairs(node.children) do
|
for _, filenode in ipairs(node.children) do
|
||||||
local grpnode = node.parent.children[filenode.name]
|
local grpnode = node.parent.children[filenode.name]
|
||||||
if not grpnode then
|
if not grpnode then
|
||||||
grpnode = tree.insert(node.parent, tree.new(filenode.name))
|
grpnode = tree.insert(node.parent, tree.new(filenode.name))
|
||||||
grpnode.kind = "vgroup"
|
grpnode.kind = "vgroup"
|
||||||
end
|
end
|
||||||
|
|
||||||
-- convert the file node to a language node and add to the group
|
-- convert the file node to a language node and add to the group
|
||||||
filenode.name = path.getbasename(lang)
|
filenode.name = path.getbasename(lang)
|
||||||
tree.insert(grpnode, filenode)
|
tree.insert(grpnode, filenode)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- remove this directory from the tree
|
-- remove this directory from the tree
|
||||||
tree.remove(node)
|
tree.remove(node)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
-- the special folder "Frameworks" lists all linked frameworks
|
-- the special folder "Frameworks" lists all linked frameworks
|
||||||
tr.frameworks = tree.new("Frameworks")
|
tr.frameworks = tree.new("Frameworks")
|
||||||
for cfg in project.eachconfig(prj) do
|
for cfg in project.eachconfig(prj) do
|
||||||
for _, link in ipairs(config.getlinks(cfg, "system", "fullpath")) do
|
for _, link in ipairs(config.getlinks(cfg, "system", "fullpath")) do
|
||||||
@ -73,9 +73,9 @@
|
|||||||
if xcode.isframework(name) and not tr.frameworks.children[name] then
|
if xcode.isframework(name) and not tr.frameworks.children[name] then
|
||||||
node = tree.insert(tr.frameworks, tree.new(name))
|
node = tree.insert(tr.frameworks, tree.new(name))
|
||||||
node.path = link
|
node.path = link
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- only add it to the tree if there are frameworks to link
|
-- only add it to the tree if there are frameworks to link
|
||||||
if #tr.frameworks.children > 0 then
|
if #tr.frameworks.children > 0 then
|
||||||
@ -84,7 +84,7 @@
|
|||||||
|
|
||||||
-- the special folder "Products" holds the target produced by the project; this
|
-- the special folder "Products" holds the target produced by the project; this
|
||||||
-- is populated below
|
-- is populated below
|
||||||
tr.products = tree.insert(tr, tree.new("Products"))
|
tr.products = tree.insert(tr, tree.new("Products"))
|
||||||
|
|
||||||
-- the special folder "Projects" lists sibling project dependencies
|
-- the special folder "Projects" lists sibling project dependencies
|
||||||
tr.projects = tree.new("Projects")
|
tr.projects = tree.new("Projects")
|
||||||
@ -95,31 +95,31 @@
|
|||||||
xcode.addDependency(prj, tr, dep, false)
|
xcode.addDependency(prj, tr, dep, false)
|
||||||
end
|
end
|
||||||
|
|
||||||
if #tr.projects.children > 0 then
|
if #tr.projects.children > 0 then
|
||||||
tree.insert(tr, tr.projects)
|
tree.insert(tr, tr.projects)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Final setup
|
-- Final setup
|
||||||
tree.traverse(tr, {
|
tree.traverse(tr, {
|
||||||
onnode = function(node)
|
onnode = function(node)
|
||||||
-- assign IDs to every node in the tree
|
-- assign IDs to every node in the tree
|
||||||
node.id = xcode.newid(node.name, nil, node.path)
|
node.id = xcode.newid(node.name, nil, node.path)
|
||||||
|
|
||||||
node.isResource = xcode.isItemResource(prj, node)
|
node.isResource = xcode.isItemResource(prj, node)
|
||||||
|
|
||||||
-- assign build IDs to buildable files
|
-- assign build IDs to buildable files
|
||||||
if xcode.getbuildcategory(node) and not node.excludefrombuild then
|
if xcode.getbuildcategory(node) and not node.excludefrombuild then
|
||||||
node.buildid = xcode.newid(node.name, "build", node.path)
|
node.buildid = xcode.newid(node.name, "build", node.path)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- remember key files that are needed elsewhere
|
-- remember key files that are needed elsewhere
|
||||||
if string.endswith(node.name, "Info.plist") then
|
if string.endswith(node.name, "Info.plist") then
|
||||||
tr.infoplist = node
|
tr.infoplist = node
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
}, true)
|
}, true)
|
||||||
|
|
||||||
-- Plug in the product node into the Products folder in the tree. The node
|
-- Plug in the product node into the Products folder in the tree. The node
|
||||||
-- was built in xcode.prepareWorkspace() in xcode_common.lua; it contains IDs
|
-- was built in xcode.prepareWorkspace() in xcode_common.lua; it contains IDs
|
||||||
-- that are necessary for inter-project dependencies
|
-- that are necessary for inter-project dependencies
|
||||||
node = tree.insert(tr.products, prj.xcode.projectnode)
|
node = tree.insert(tr.products, prj.xcode.projectnode)
|
||||||
|
@ -1110,7 +1110,7 @@
|
|||||||
tokens = true,
|
tokens = true,
|
||||||
}
|
}
|
||||||
|
|
||||||
api.register {
|
api.register {
|
||||||
name = "usingdirs",
|
name = "usingdirs",
|
||||||
scope = "config",
|
scope = "config",
|
||||||
kind = "list:directory",
|
kind = "list:directory",
|
||||||
|
@ -94,9 +94,9 @@
|
|||||||
|
|
||||||
function cs.getresourcefilename(cfg, fname)
|
function cs.getresourcefilename(cfg, fname)
|
||||||
if path.getextension(fname) == ".resx" then
|
if path.getextension(fname) == ".resx" then
|
||||||
local name = cfg.buildtarget.basename .. "."
|
local name = cfg.buildtarget.basename .. "."
|
||||||
local dir = path.getdirectory(fname)
|
local dir = path.getdirectory(fname)
|
||||||
if dir ~= "." then
|
if dir ~= "." then
|
||||||
name = name .. path.translate(dir, ".") .. "."
|
name = name .. path.translate(dir, ".") .. "."
|
||||||
end
|
end
|
||||||
return "$(OBJDIR)/" .. p.esc(name .. path.getbasename(fname)) .. ".resources"
|
return "$(OBJDIR)/" .. p.esc(name .. path.getbasename(fname)) .. ".resources"
|
||||||
|
@ -318,12 +318,12 @@
|
|||||||
-- The alias name (another string value).
|
-- The alias name (another string value).
|
||||||
---
|
---
|
||||||
|
|
||||||
function api.alias(original, alias)
|
function api.alias(original, alias)
|
||||||
p.alias(_G, original, alias)
|
p.alias(_G, original, alias)
|
||||||
if _G["remove" .. original] then
|
if _G["remove" .. original] then
|
||||||
p.alias(_G, "remove" .. original, "remove" .. alias)
|
p.alias(_G, "remove" .. original, "remove" .. alias)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -231,7 +231,7 @@
|
|||||||
-- An array containing the requested link target information.
|
-- An array containing the requested link target information.
|
||||||
--
|
--
|
||||||
|
|
||||||
function config.getlinks(cfg, kind, part, linkage)
|
function config.getlinks(cfg, kind, part, linkage)
|
||||||
local result = {}
|
local result = {}
|
||||||
|
|
||||||
-- If I'm building a list of link directories, include libdirs
|
-- If I'm building a list of link directories, include libdirs
|
||||||
|
@ -90,7 +90,7 @@
|
|||||||
--
|
--
|
||||||
|
|
||||||
function path.getextension(p)
|
function path.getextension(p)
|
||||||
p = path.getname(p)
|
p = path.getname(p)
|
||||||
local i = p:findlast(".", true)
|
local i = p:findlast(".", true)
|
||||||
if (i) then
|
if (i) then
|
||||||
return p:sub(i)
|
return p:sub(i)
|
||||||
|
@ -190,9 +190,9 @@
|
|||||||
for cfg in project.eachconfig(prj) do
|
for cfg in project.eachconfig(prj) do
|
||||||
if not depsOnly then
|
if not depsOnly then
|
||||||
for _, link in ipairs(cfg.links) do
|
for _, link in ipairs(cfg.links) do
|
||||||
if link ~= prj.name then
|
if link ~= prj.name then
|
||||||
add_to_project_list(cfg, link, result)
|
add_to_project_list(cfg, link, result)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if not linkOnly then
|
if not linkOnly then
|
||||||
|
@ -31,10 +31,10 @@ int os_islink(lua_State* L)
|
|||||||
#else
|
#else
|
||||||
{
|
{
|
||||||
struct stat buf;
|
struct stat buf;
|
||||||
if (lstat(path, &buf) == 0) {
|
if (lstat(path, &buf) == 0) {
|
||||||
lua_pushboolean(L, S_ISLNK(buf.st_mode));
|
lua_pushboolean(L, S_ISLNK(buf.st_mode));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ int os_stat(lua_State* L)
|
|||||||
struct stat s;
|
struct stat s;
|
||||||
|
|
||||||
const char* filename = luaL_checkstring(L, 1);
|
const char* filename = luaL_checkstring(L, 1);
|
||||||
if (stat(filename, &s) != 0)
|
if (stat(filename, &s) != 0)
|
||||||
{
|
{
|
||||||
lua_pushnil(L);
|
lua_pushnil(L);
|
||||||
switch (errno)
|
switch (errno)
|
||||||
|
@ -501,8 +501,8 @@ static int run_premake_main(lua_State* L, const char* script)
|
|||||||
* argument allowed as an override. Debug builds will look at the
|
* argument allowed as an override. Debug builds will look at the
|
||||||
* local file system first, then fall back to embedded. */
|
* local file system first, then fall back to embedded. */
|
||||||
#if defined(NDEBUG)
|
#if defined(NDEBUG)
|
||||||
int z = premake_test_file(L, script,
|
int z = premake_test_file(L, script,
|
||||||
TEST_SCRIPTS | TEST_EMBEDDED);
|
TEST_SCRIPTS | TEST_EMBEDDED);
|
||||||
#else
|
#else
|
||||||
int z = premake_test_file(L, script,
|
int z = premake_test_file(L, script,
|
||||||
TEST_LOCAL | TEST_SCRIPTS | TEST_PATH | TEST_EMBEDDED);
|
TEST_LOCAL | TEST_SCRIPTS | TEST_PATH | TEST_EMBEDDED);
|
||||||
@ -529,10 +529,10 @@ static int run_premake_main(lua_State* L, const char* script)
|
|||||||
* contents of the file's script.
|
* contents of the file's script.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const buildin_mapping* premake_find_embedded_script(const char* filename)
|
const buildin_mapping* premake_find_embedded_script(const char* filename)
|
||||||
{
|
{
|
||||||
#if !defined(PREMAKE_NO_BUILTIN_SCRIPTS)
|
#if !defined(PREMAKE_NO_BUILTIN_SCRIPTS)
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; builtin_scripts[i].name != NULL; ++i) {
|
for (i = 0; builtin_scripts[i].name != NULL; ++i) {
|
||||||
if (strcmp(builtin_scripts[i].name, filename) == 0) {
|
if (strcmp(builtin_scripts[i].name, filename) == 0) {
|
||||||
return builtin_scripts + i;
|
return builtin_scripts + i;
|
||||||
@ -540,7 +540,7 @@ static int run_premake_main(lua_State* L, const char* script)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -123,7 +123,7 @@
|
|||||||
if fcfg.buildaction == "Component" or
|
if fcfg.buildaction == "Component" or
|
||||||
fcfg.buildaction == "Form" or
|
fcfg.buildaction == "Form" or
|
||||||
fcfg.buildaction == "UserControl"
|
fcfg.buildaction == "UserControl"
|
||||||
then
|
then
|
||||||
info.SubType = fcfg.buildaction
|
info.SubType = fcfg.buildaction
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -438,7 +438,7 @@
|
|||||||
if #static_syslibs > 1 then
|
if #static_syslibs > 1 then
|
||||||
table.insert(static_syslibs, "-Wl,-Bdynamic")
|
table.insert(static_syslibs, "-Wl,-Bdynamic")
|
||||||
move(static_syslibs, result)
|
move(static_syslibs, result)
|
||||||
end
|
end
|
||||||
move(shared_syslibs, result)
|
move(shared_syslibs, result)
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
@ -41,6 +41,6 @@ ifeq ($(config),debug)
|
|||||||
ifeq ($(origin AR), default)
|
ifeq ($(origin AR), default)
|
||||||
AR = ar
|
AR = ar
|
||||||
endif
|
endif
|
||||||
]]
|
]]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ else
|
|||||||
endif
|
endif
|
||||||
$(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
|
$(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
|
||||||
|
|
||||||
]]
|
]]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@ -81,7 +81,7 @@ else
|
|||||||
endif
|
endif
|
||||||
$(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
|
$(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
|
||||||
|
|
||||||
]]
|
]]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
@ -153,38 +153,38 @@
|
|||||||
-- Check a linking to a sibling shared library using -l and -L.
|
-- Check a linking to a sibling shared library using -l and -L.
|
||||||
--
|
--
|
||||||
|
|
||||||
function suite.links_onSiblingSharedLib()
|
function suite.links_onSiblingSharedLib()
|
||||||
links "MyProject2"
|
links "MyProject2"
|
||||||
flags { "RelativeLinks" }
|
flags { "RelativeLinks" }
|
||||||
|
|
||||||
test.createproject(wks)
|
test.createproject(wks)
|
||||||
kind "SharedLib"
|
kind "SharedLib"
|
||||||
location "build"
|
location "build"
|
||||||
|
|
||||||
prepare { "ldFlags", "libs", "ldDeps" }
|
prepare { "ldFlags", "libs", "ldDeps" }
|
||||||
test.capture [[
|
test.capture [[
|
||||||
ALL_LDFLAGS += $(LDFLAGS) -Lbuild/bin/Debug -Wl,-rpath,'$$ORIGIN/../../build/bin/Debug' -s
|
ALL_LDFLAGS += $(LDFLAGS) -Lbuild/bin/Debug -Wl,-rpath,'$$ORIGIN/../../build/bin/Debug' -s
|
||||||
LIBS += -lMyProject2
|
LIBS += -lMyProject2
|
||||||
LDDEPS += build/bin/Debug/libMyProject2.so
|
LDDEPS += build/bin/Debug/libMyProject2.so
|
||||||
]]
|
]]
|
||||||
end
|
end
|
||||||
|
|
||||||
function suite.links_onMacOSXSiblingSharedLib()
|
function suite.links_onMacOSXSiblingSharedLib()
|
||||||
_TARGET_OS = "macosx"
|
_TARGET_OS = "macosx"
|
||||||
links "MyProject2"
|
links "MyProject2"
|
||||||
flags { "RelativeLinks" }
|
flags { "RelativeLinks" }
|
||||||
|
|
||||||
test.createproject(wks)
|
test.createproject(wks)
|
||||||
kind "SharedLib"
|
kind "SharedLib"
|
||||||
location "build"
|
location "build"
|
||||||
|
|
||||||
prepare { "ldFlags", "libs", "ldDeps" }
|
prepare { "ldFlags", "libs", "ldDeps" }
|
||||||
test.capture [[
|
test.capture [[
|
||||||
ALL_LDFLAGS += $(LDFLAGS) -Lbuild/bin/Debug -Wl,-rpath,'@loader_path/../../build/bin/Debug' -Wl,-x
|
ALL_LDFLAGS += $(LDFLAGS) -Lbuild/bin/Debug -Wl,-rpath,'@loader_path/../../build/bin/Debug' -Wl,-x
|
||||||
LIBS += -lMyProject2
|
LIBS += -lMyProject2
|
||||||
LDDEPS += build/bin/Debug/libMyProject2.dylib
|
LDDEPS += build/bin/Debug/libMyProject2.dylib
|
||||||
]]
|
]]
|
||||||
end
|
end
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Check a linking multiple siblings.
|
-- Check a linking multiple siblings.
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
OBJECTS := \
|
OBJECTS := \
|
||||||
$(OBJDIR)/hello.o \
|
$(OBJDIR)/hello.o \
|
||||||
|
|
||||||
]]
|
]]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@ -52,7 +52,7 @@ OBJECTS := \
|
|||||||
OBJECTS := \
|
OBJECTS := \
|
||||||
$(OBJDIR)/hello.o \
|
$(OBJDIR)/hello.o \
|
||||||
|
|
||||||
]]
|
]]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@ -85,7 +85,7 @@ ifeq ($(config),release)
|
|||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
]]
|
]]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@ -101,7 +101,7 @@ OBJECTS := \
|
|||||||
$(OBJDIR)/hello.o \
|
$(OBJDIR)/hello.o \
|
||||||
$(OBJDIR)/hello1.o \
|
$(OBJDIR)/hello1.o \
|
||||||
|
|
||||||
]]
|
]]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
test.capture [[
|
test.capture [[
|
||||||
all: prebuild prelink $(TARGET)
|
all: prebuild prelink $(TARGET)
|
||||||
@:
|
@:
|
||||||
]]
|
]]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@ -53,5 +53,5 @@ all: prebuild prelink $(TARGET) $(dir $(TARGETDIR))PkgInfo $(dir $(TARGETDIR))In
|
|||||||
|
|
||||||
$(dir $(TARGETDIR))PkgInfo:
|
$(dir $(TARGETDIR))PkgInfo:
|
||||||
$(dir $(TARGETDIR))Info.plist:
|
$(dir $(TARGETDIR))Info.plist:
|
||||||
]]
|
]]
|
||||||
end
|
end
|
||||||
|
@ -31,5 +31,5 @@
|
|||||||
make.cppTools(cfg, p.tools.gcc)
|
make.cppTools(cfg, p.tools.gcc)
|
||||||
test.capture [[
|
test.capture [[
|
||||||
RESCOMP = windres
|
RESCOMP = windres
|
||||||
]]
|
]]
|
||||||
end
|
end
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
make.cppFlags(cfg, p.tools.gcc)
|
make.cppFlags(cfg, p.tools.gcc)
|
||||||
test.capture [[
|
test.capture [[
|
||||||
ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP -I$(LIBOGC_INC) $(MACHDEP) $(DEFINES) $(INCLUDES)
|
ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP -I$(LIBOGC_INC) $(MACHDEP) $(DEFINES) $(INCLUDES)
|
||||||
]]
|
]]
|
||||||
end
|
end
|
||||||
|
|
||||||
function suite.writesCorrectLinkerFlags()
|
function suite.writesCorrectLinkerFlags()
|
||||||
|
@ -38,8 +38,8 @@
|
|||||||
EMBEDFILES += \
|
EMBEDFILES += \
|
||||||
$(OBJDIR)/MyProject.Hello.resources \
|
$(OBJDIR)/MyProject.Hello.resources \
|
||||||
|
|
||||||
]]
|
]]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--
|
--
|
||||||
@ -53,8 +53,8 @@ EMBEDFILES += \
|
|||||||
EMBEDFILES += \
|
EMBEDFILES += \
|
||||||
$(OBJDIR)/MyProject.Hello.resources \
|
$(OBJDIR)/MyProject.Hello.resources \
|
||||||
|
|
||||||
]]
|
]]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--
|
--
|
||||||
@ -71,5 +71,5 @@ EMBEDFILES += \
|
|||||||
EMBEDFILES += \
|
EMBEDFILES += \
|
||||||
Hello.txt \
|
Hello.txt \
|
||||||
|
|
||||||
]]
|
]]
|
||||||
end
|
end
|
||||||
|
@ -35,8 +35,8 @@
|
|||||||
prepare()
|
prepare()
|
||||||
test.capture [[
|
test.capture [[
|
||||||
FLAGS = /noconfig
|
FLAGS = /noconfig
|
||||||
]]
|
]]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--
|
--
|
||||||
@ -48,8 +48,8 @@
|
|||||||
prepare()
|
prepare()
|
||||||
test.capture [[
|
test.capture [[
|
||||||
FLAGS = /unsafe /noconfig
|
FLAGS = /unsafe /noconfig
|
||||||
]]
|
]]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--
|
--
|
||||||
@ -61,5 +61,5 @@
|
|||||||
prepare()
|
prepare()
|
||||||
test.capture [[
|
test.capture [[
|
||||||
FLAGS = /noconfig /win32icon:"MyProject.ico"
|
FLAGS = /noconfig /win32icon:"MyProject.ico"
|
||||||
]]
|
]]
|
||||||
end
|
end
|
||||||
|
@ -5,56 +5,56 @@
|
|||||||
--
|
--
|
||||||
|
|
||||||
local p = premake
|
local p = premake
|
||||||
local suite = test.declare("make_cs_links")
|
local suite = test.declare("make_cs_links")
|
||||||
local make = p.make
|
local make = p.make
|
||||||
local cs = p.make.cs
|
local cs = p.make.cs
|
||||||
local project = p.project
|
local project = p.project
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Setup
|
-- Setup
|
||||||
--
|
--
|
||||||
|
|
||||||
local wks, prj
|
local wks, prj
|
||||||
|
|
||||||
function suite.setup()
|
function suite.setup()
|
||||||
wks, prj = test.createWorkspace()
|
wks, prj = test.createWorkspace()
|
||||||
end
|
end
|
||||||
|
|
||||||
local function prepare()
|
local function prepare()
|
||||||
local cfg = test.getconfig(prj, "Debug")
|
local cfg = test.getconfig(prj, "Debug")
|
||||||
make.csLinkCmd(cfg, p.tools.dotnet)
|
make.csLinkCmd(cfg, p.tools.dotnet)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Should return an empty assignment if nothing has been specified.
|
-- Should return an empty assignment if nothing has been specified.
|
||||||
--
|
--
|
||||||
|
|
||||||
function suite.isEmptyAssignment_onNoSettings()
|
function suite.isEmptyAssignment_onNoSettings()
|
||||||
prepare()
|
prepare()
|
||||||
test.capture [[
|
test.capture [[
|
||||||
DEPENDS =
|
DEPENDS =
|
||||||
]]
|
]]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Files that can be compiled should be listed here.
|
-- Files that can be compiled should be listed here.
|
||||||
--
|
--
|
||||||
|
|
||||||
function suite.doesListLinkDependencyFiles()
|
function suite.doesListLinkDependencyFiles()
|
||||||
links { "MyProject2", "MyProject3" }
|
links { "MyProject2", "MyProject3" }
|
||||||
|
|
||||||
test.createproject(wks)
|
test.createproject(wks)
|
||||||
kind "SharedLib"
|
kind "SharedLib"
|
||||||
language "C#"
|
language "C#"
|
||||||
|
|
||||||
test.createproject(wks)
|
test.createproject(wks)
|
||||||
kind "SharedLib"
|
kind "SharedLib"
|
||||||
language "C#"
|
language "C#"
|
||||||
|
|
||||||
prepare ()
|
prepare ()
|
||||||
test.capture [[
|
test.capture [[
|
||||||
DEPENDS = bin/Debug/MyProject2.dll bin/Debug/MyProject3.dll
|
DEPENDS = bin/Debug/MyProject2.dll bin/Debug/MyProject3.dll
|
||||||
]]
|
]]
|
||||||
end
|
end
|
||||||
|
@ -38,8 +38,8 @@
|
|||||||
SOURCES += \
|
SOURCES += \
|
||||||
Hello.cs \
|
Hello.cs \
|
||||||
|
|
||||||
]]
|
]]
|
||||||
end
|
end
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Path delimiter uses slash instead of backslash
|
-- Path delimiter uses slash instead of backslash
|
||||||
@ -68,8 +68,8 @@ SOURCES += \
|
|||||||
SOURCES += \
|
SOURCES += \
|
||||||
Hello.cs \
|
Hello.cs \
|
||||||
|
|
||||||
]]
|
]]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--
|
--
|
||||||
@ -86,5 +86,5 @@ SOURCES += \
|
|||||||
SOURCES += \
|
SOURCES += \
|
||||||
Hello.txt \
|
Hello.txt \
|
||||||
|
|
||||||
]]
|
]]
|
||||||
end
|
end
|
||||||
|
@ -44,7 +44,7 @@
|
|||||||
function suite.writesPathIfSet()
|
function suite.writesPathIfSet()
|
||||||
buildlog "logs/MyCustomLogFile.log"
|
buildlog "logs/MyCustomLogFile.log"
|
||||||
prepare()
|
prepare()
|
||||||
test.capture [[
|
test.capture [[
|
||||||
<BuildLog>
|
<BuildLog>
|
||||||
<Path>logs\MyCustomLogFile.log</Path>
|
<Path>logs\MyCustomLogFile.log</Path>
|
||||||
</BuildLog>
|
</BuildLog>
|
||||||
|
@ -127,9 +127,9 @@
|
|||||||
-- List fields should return an empty list of not set.
|
-- List fields should return an empty list of not set.
|
||||||
--
|
--
|
||||||
|
|
||||||
function suite.lists_returnsEmptyTable_onNotSet()
|
function suite.lists_returnsEmptyTable_onNotSet()
|
||||||
test.isequal({}, configset.fetch(cset, field.get("buildoptions"), {}))
|
test.isequal({}, configset.fetch(cset, field.get("buildoptions"), {}))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--
|
--
|
||||||
|
@ -147,7 +147,7 @@
|
|||||||
test.isequal("", path.getextension("filename"))
|
test.isequal("", path.getextension("filename"))
|
||||||
end
|
end
|
||||||
|
|
||||||
function suite.getextension_ReturnsEmptyString_OnPathWithDotAndNoExtension()
|
function suite.getextension_ReturnsEmptyString_OnPathWithDotAndNoExtension()
|
||||||
test.isequal("", path.getextension("/.premake/premake"))
|
test.isequal("", path.getextension("/.premake/premake"))
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -155,7 +155,7 @@
|
|||||||
test.isequal(".txt", path.getextension("filename.txt"))
|
test.isequal(".txt", path.getextension("filename.txt"))
|
||||||
end
|
end
|
||||||
|
|
||||||
function suite.getextension_ReturnsExtension_OnPathWithDot()
|
function suite.getextension_ReturnsExtension_OnPathWithDot()
|
||||||
test.isequal(".lua", path.getextension("/.premake/premake.lua"))
|
test.isequal(".lua", path.getextension("/.premake/premake.lua"))
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -222,7 +222,7 @@
|
|||||||
end
|
end
|
||||||
|
|
||||||
function suite.getrelative_ignoresTrailingSlashes()
|
function suite.getrelative_ignoresTrailingSlashes()
|
||||||
test.isequal("c", path.getrelative("/a/b/","/a/b/c"))
|
test.isequal("c", path.getrelative("/a/b/","/a/b/c"))
|
||||||
end
|
end
|
||||||
|
|
||||||
function suite.getrelative_returnsAbsPath_onContactWithFileSysRoot()
|
function suite.getrelative_returnsAbsPath_onContactWithFileSysRoot()
|
||||||
@ -410,19 +410,19 @@
|
|||||||
end
|
end
|
||||||
|
|
||||||
function suite.getabsolute_replaceExtensionWithDotMultipleDots()
|
function suite.getabsolute_replaceExtensionWithDotMultipleDots()
|
||||||
test.isequal("/nunit.framework.foo", path.replaceextension("/nunit.framework.dll",".foo"))
|
test.isequal("/nunit.framework.foo", path.replaceextension("/nunit.framework.dll",".foo"))
|
||||||
end
|
end
|
||||||
|
|
||||||
function suite.getabsolute_replaceExtensionCompletePath()
|
function suite.getabsolute_replaceExtensionCompletePath()
|
||||||
test.isequal("/nunit/framework/main.foo", path.replaceextension("/nunit/framework/main.cpp",".foo"))
|
test.isequal("/nunit/framework/main.foo", path.replaceextension("/nunit/framework/main.cpp",".foo"))
|
||||||
end
|
end
|
||||||
|
|
||||||
function suite.getabsolute_replaceExtensionWithoutExtension()
|
function suite.getabsolute_replaceExtensionWithoutExtension()
|
||||||
test.isequal("/nunit/framework/main.foo", path.replaceextension("/nunit/framework/main",".foo"))
|
test.isequal("/nunit/framework/main.foo", path.replaceextension("/nunit/framework/main",".foo"))
|
||||||
end
|
end
|
||||||
|
|
||||||
function suite.getabsolute_replaceExtensionWithEmptyString()
|
function suite.getabsolute_replaceExtensionWithEmptyString()
|
||||||
test.isequal("foo", path.replaceextension("foo.lua",""))
|
test.isequal("foo", path.replaceextension("foo.lua",""))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
local function prepare()
|
local function prepare()
|
||||||
wks = test.getWorkspace(wks)
|
wks = test.getWorkspace(wks)
|
||||||
prj = test.getproject(wks, 1)
|
prj = test.getproject(wks, 1)
|
||||||
cfg = test.getconfig(prj, "Debug")
|
cfg = test.getconfig(prj, "Debug")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
@ -124,11 +124,11 @@
|
|||||||
test.isequal("Headers/myproject/hello.h", run())
|
test.isequal("Headers/myproject/hello.h", run())
|
||||||
end
|
end
|
||||||
|
|
||||||
function suite.matchBaseFileName_onWildcardExtension()
|
function suite.matchBaseFileName_onWildcardExtension()
|
||||||
files { "hello.cpp" }
|
files { "hello.cpp" }
|
||||||
vpaths { ["Sources"] = "hello.*" }
|
vpaths { ["Sources"] = "hello.*" }
|
||||||
test.isequal("Sources/hello.cpp", run())
|
test.isequal("Sources/hello.cpp", run())
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--
|
--
|
||||||
|
Reference in New Issue
Block a user