Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
actboy168 committed Feb 26, 2024
1 parent 5602232 commit 97c8a88
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 19 deletions.
2 changes: 1 addition & 1 deletion main.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package.procdir = package.cpath:match("(.+)[/][^/]+$")
package.path = package.procdir.."/scripts/?.lua"
require 'main'
require "main"
4 changes: 2 additions & 2 deletions make.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
local lm = require 'luamake'
local lm = require "luamake"
lm:required_version "1.0"

local isWindows = lm.os == 'windows'
local isWindows = lm.os == "windows"

if lm.prebuilt == nil then
print("Please use `"..(isWindows and [[.\compile\install.bat]] or [[./compile/install.sh]]).."`.")
Expand Down
14 changes: 7 additions & 7 deletions scripts/compiler/gcc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ local gcc = {
maxspeed = "-O3",
},
warnings = {
off = "-w",
on = "-Wall",
all = "-Wall -Wextra",
error = "-Wall -Werror",
off = "-w",
on = "-Wall",
all = "-Wall -Wextra",
error = "-Wall -Werror",
strict = "-Wall -Wextra -Werror",
},
cxx = {
Expand Down Expand Up @@ -205,9 +205,9 @@ end
function gcc.rule_rc(w, name)
if globals.os == "windows" and globals.hostshell == "sh" then
w:rule("rc_"..name, [[windres -i $in -o $out]],
{
description = "Compile Res $out",
})
{
description = "Compile Res $out",
})
end
end

Expand Down
8 changes: 4 additions & 4 deletions scripts/compiler/msvc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ local cl = {
maxspeed = "/O2 /Zc:inline /fp:fast",
},
warnings = {
off = "/W0",
on = "/W3",
all = "/W4",
error = "/W3 /WX",
off = "/W0",
on = "/W3",
all = "/W4",
error = "/W3 /WX",
strict = "/W4 /WX",
},
cxx = {
Expand Down
2 changes: 1 addition & 1 deletion scripts/env/find_msvc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ local function installpath()
print("[vswhere]", result)
os.exit(code)
end
if result == '' then
if result == "" then
print("[vswhere] VisualStudio not found", result)
os.exit(false)
end
Expand Down
2 changes: 1 addition & 1 deletion scripts/env/ndk.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ local function find_ndk()
if globals.hostos == "windows" then
local LocalAppData = os.getenv "LocalAppData"
if LocalAppData then
local rootdir = LocalAppData:gsub("\\", "/") .. "/Android/Sdk/ndk/"
local rootdir = LocalAppData:gsub("\\", "/").."/Android/Sdk/ndk/"
if fs.exists(rootdir) then
local max
local max_ver
Expand Down
2 changes: 1 addition & 1 deletion scripts/fsutil.lua
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ function fsutil.absolute(base, path)
end

function fsutil.relative(path, base)
if base:sub(1,1) ~= path:sub(1,1) then
if base:sub(1, 1) ~= path:sub(1, 1) then
return path
end
local rpath = normalize(path)
Expand Down
2 changes: 1 addition & 1 deletion scripts/glob.lua
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ local function pattern_compile(res, path, ignore)
end
end)
if hasRoot then
pattern[1] = "/" .. (pattern[1] or "")
pattern[1] = "/"..(pattern[1] or "")
end
res[#res+1] = pattern
end
Expand Down
4 changes: 4 additions & 0 deletions scripts/workspace.lua
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ local function create(workdir, parent, attri)
end
return parent[k]
end

function mt:__newindex(k, v)
if arguments.args[k] ~= nil then
return
Expand All @@ -228,12 +229,14 @@ local function create(workdir, parent, attri)
attri[k] = pathutil.accept(workdir, v)
end
end

if globals == attri then
function mt:__pairs()
return function (_, k)
return next(attri, k)
end
end

return setmetatable({ workdir = workdir }, mt)
end
function mt:__pairs()
Expand All @@ -258,6 +261,7 @@ local function create(workdir, parent, attri)
return newk, newv
end
end

return setmetatable({ workdir = workdir }, mt)
end

Expand Down
1 change: 0 additions & 1 deletion scripts/writer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -939,7 +939,6 @@ function api:required_version(buildVersion)
end
end


local MainWorkspace = workspace.create(globals.workdir, api, globals)

function api:default(attribute)
Expand Down

0 comments on commit 97c8a88

Please sign in to comment.