-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathproject_lib.lua
87 lines (64 loc) · 2.03 KB
/
project_lib.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
--
-- Copyright 2023 Milos Tosic. All rights reserved.
-- License: http://www.opensource.org/licenses/BSD-2-Clause
--
function addProject_lib(_name, _libType, _shared, _nameAppend, _disablePCH)
if _ACTION == nil then return end
if _libType == Lib.Tool then
group ("libs_tools")
elseif _libType == Lib.Game then
group ("liba_game")
else
group ("libs")
end
_nameAppend = _nameAppend or ""
project (_name .. _nameAppend)
LastLibLoaded = project().name
_libType = _libType or Lib.Runtime
_shared = _shared or false
_disablePCH = _disablePCH or false
local libKind = "StaticLib"
if _shared then
libKind = "SharedLib"
end
language "C++"
kind ( libKind )
uuid ( os.uuid(project().name) )
local libsPath = getProjectPath(_name, ProjectPath.Root)
local projectPath = libsPath .. "/" .. _name
project().path = projectPath
local srcFilesPath = projectPath .. "/src/"
local incFilesPath = projectPath .. "/inc/"
local sourceFiles = mergeTables( { srcFilesPath .. "**.cpp" },
{ srcFilesPath .. "**.cxx" },
{ srcFilesPath .. "**.c" },
{ srcFilesPath .. "**.h" },
{ incFilesPath .. "**.h" } )
files { sourceFiles }
local targetOS = getTargetOS()
if targetOS == "ios" or targetOS == "osx" then
files { srcFilesPath .. "**.mm" }
end
excludes { projectPath .. "/test/**.*" }
excludes { projectPath .. "/samples/**.*" }
if _disablePCH ~= true then
addPCH( srcFilesPath, _name )
end
shaderFiles = os.matchfiles( srcFilesPath .. "**.sc" )
includedirs {
libsPath,
incFilesPath,
srcFilesPath
}
addIncludePath(_name, projectPath .. "/3rd/")
flags { Flags_Libraries }
assert(loadfile(RTM_SCRIPTS_DIR .. "configurations.lua"))( sourceFiles,
true, -- IS_LIBRARY
_shared, -- IS_SHARED_LIBRARY
false, -- COPY_QT_DLLS
false, -- WITH_QT
false, -- EXECUTABLE
_name
)
addDependencies(project().name)
end