Reverse search order of module naming variations to avoid matching embedded path ahead of local file

This commit is contained in:
Jason Perkins 2015-02-12 18:29:48 -05:00
parent e9ac1dc74e
commit 8390255470
2 changed files with 21 additions and 15 deletions

View File

@ -160,25 +160,24 @@
---
function p.main.moduleLoader(name)
local chunk = loadfile(name .. ".lua")
local dir = path.getdirectory(name)
local base = path.getname(name)
-- try the Premake standard name/name.lua
if not chunk then
local dir = path.getdirectory(name)
local name = path.getname(name)
if dir ~= "." then
dir = dir .. "/" .. name
else
dir = name
end
name = dir .. "/" .. name .. ".lua"
chunk = loadfile(name)
if dir ~= "." then
dir = dir .. "/" .. base
else
dir = base
end
-- Premake standard is moduleName/moduleName.lua
local relPath = dir .. "/" .. base .. ".lua"
local chunk = loadfile("modules/" .. relPath)
if not chunk then
chunk = loadfile("modules/" .. name)
chunk = loadfile(relPath)
end
if not chunk then
chunk = loadfile(name .. ".lua")
end
if not chunk then

View File

@ -282,6 +282,13 @@
test.contains({ "-framework Cocoa" }, gcc.getlinks(cfg))
end
function suite.links_onSystemLibs_onWindows()
_OS = "windows"
links { "user32", "ole32" }
prepare()
test.contains({ "-luser32", "-lole32" }, gcc.getlinks(cfg))
end
--
-- When linking to a static sibling library, the relative path to the library