Skip to content

Commit 8801f76

Browse files
committed
- transfer from CMake to premake5
- simplify build
1 parent d7425bb commit 8801f76

File tree

606 files changed

+12286
-112781
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

606 files changed

+12286
-112781
lines changed

.gitignore

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
cmake-build*
2-
build
3-
.idea
4-
.vscode
5-
.vs
1+
project_vs**/
2+
bin/
3+
*.idea
4+
*.vscode
5+
*.vs
6+
*.exe

.gitmodules

Lines changed: 0 additions & 12 deletions
This file was deleted.

.premake_modules/asan.lua

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
require('vstudio')
2+
3+
-- Add new command line option
4+
newoption {
5+
trigger = "Sanitizer",
6+
value = "Tool",
7+
description = "A sanitizer to add to the build",
8+
allowed = {
9+
{ "Asan", "Address Sanitizer"}
10+
}
11+
}
12+
13+
-- Register api command
14+
premake.api.register{
15+
name="enableASAN",
16+
scope = "config",
17+
kind = "boolean",
18+
default_value = "off",
19+
}
20+
21+
premake.override(premake.vstudio.vc2010, "configurationProperties", function(base, cfg)
22+
local m = premake.vstudio.vc2010
23+
m.propertyGroup(cfg, "Configuration")
24+
premake.callArray(m.elements.configurationProperties, cfg)
25+
if cfg.enableASAN then
26+
m.element("EnableASAN", nil, "true")
27+
end
28+
premake.pop('</PropertyGroup>')
29+
end)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
return {
2+
"usage.lua",
3+
}

.premake_modules/usage/stack.lua

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
-- Stack Table
2+
-- Uses a table as stack, use <table>:push(value) and <table>:pop()
3+
-- Lua 5.1 compatible
4+
5+
unpack = table.unpack or unpack
6+
7+
-- GLOBAL
8+
Stack = {}
9+
10+
-- Create a Table with stack functions
11+
function Stack:Create()
12+
13+
-- stack table
14+
local t = {}
15+
-- entry table
16+
t._et = {}
17+
18+
-- push a value on to the stack
19+
function t:push(...)
20+
if ... then
21+
local targs = {...}
22+
-- add values
23+
for _,v in ipairs(targs) do
24+
table.insert(self._et, v)
25+
end
26+
end
27+
end
28+
29+
-- pop a value from the stack
30+
function t:pop(num)
31+
32+
-- get num values from stack
33+
local num = num or 1
34+
35+
-- return table
36+
local entries = {}
37+
38+
-- get values into entries
39+
for i = 1, num do
40+
-- get last entry
41+
if #self._et ~= 0 then
42+
table.insert(entries, self._et[#self._et])
43+
-- remove last value
44+
table.remove(self._et)
45+
else
46+
break
47+
end
48+
end
49+
-- return unpacked entries
50+
return unpack(entries)
51+
end
52+
53+
-- get entries
54+
function t:getn()
55+
return #self._et
56+
end
57+
58+
-- get entry form index
59+
function t:get(index)
60+
return self._et[index]
61+
end
62+
63+
-- list values
64+
function t:list()
65+
for i,v in pairs(self._et) do
66+
print(i, v)
67+
end
68+
end
69+
-- list values
70+
function t:find_value(value)
71+
for i,v in pairs(self._et) do
72+
if v == value then
73+
return i
74+
end
75+
end
76+
return nil
77+
end
78+
return t
79+
end

0 commit comments

Comments
 (0)