-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpremake5.lua
More file actions
113 lines (92 loc) · 3.24 KB
/
premake5.lua
File metadata and controls
113 lines (92 loc) · 3.24 KB
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
print("_MAIN_SCRIPT_DIR", _MAIN_SCRIPT_DIR)
-- premake5.lua
require ".premake_modules/usage"
require ".premake_modules/properties"
require ".premake_modules/androidndk"
require ".premake_modules/unitybuild"
require ".premake_modules/wxwidgets"
require ".premake_modules/vscode"
IS_ANDROID = (_ACTION == "androidndk")
local CAN_BUILD_TOOLS = (_TARGET_OS == "linux" or _TARGET_OS == "windows")
local CAN_BUILD_GUI_TOOLS = (--[[os.target() == "linux" or]] _TARGET_OS == "windows")
WORKSPACE_NAME = (WORKSPACE_NAME or "Equilibrium2")
ENGINE_DIR = ENGINE_DIR or _WORKING_DIR
-- project can define own Windows SDK version
WINSDK_VER = WINSDK_VER or os.getenv("WINSDK_VER") or "latest"
BUILD_SINGLE_FILE = iif(BUILD_SINGLE_FILE == nil, false, BUILD_SINGLE_FILE)
ENABLE_TOOLS = iif(ENABLE_TOOLS == nil, CAN_BUILD_TOOLS, ENABLE_TOOLS)
ENABLE_GUI_TOOLS = iif(ENABLE_GUI_TOOLS == nil, CAN_BUILD_GUI_TOOLS, ENABLE_GUI_TOOLS)
ENABLE_MATSYSTEM = iif(ENABLE_MATSYSTEM == nil, true, ENABLE_MATSYSTEM)
ENABLE_TESTS = iif(ENABLE_TESTS == nil, false, ENABLE_TESTS)
ENABLE_LIVEPP = iif(ENABLE_LIVEPP == nil, false, ENABLE_LIVEPP)
print("Workspace", WORKSPACE_NAME)
print("Target OS", _TARGET_OS)
print("Target Arch", _TARGET_ARCH or "Not defined")
if _TARGET_OS == "windows" then
print("Windows SDK =", WINSDK_VER)
end
print("\n")
print("Build details:")
print("Single File Compilation =", BUILD_SINGLE_FILE)
print("ENABLE_TOOLS =", ENABLE_TOOLS)
print("ENABLE_MATSYSTEM =", ENABLE_MATSYSTEM)
print("ENABLE_TESTS =", ENABLE_TESTS)
print("ENABLE_LIVEPP =", ENABLE_LIVEPP)
print("\n")
-- you can redefine dependencies
DependencyPath = {
["libsdl"] = os.getenv("SDL2_DIR") or "SDL2",
["openal"] = os.getenv("OPENAL_DIR") or "openal-soft",
["Android_libsdl"] = os.getenv("SDL2_DIR") or "SDL2",
["Android_openal"] = os.getenv("OPENAL_DIR") or "openal-soft",
}
include "premake5-properties.lua"
-- Main workspace
workspace(WORKSPACE_NAME)
properties {
"e2_ws_settings",
"e2_ws_configurations",
"gcc_clang",
"windows_msvc"
}
configurations {
"Debug", -- full debug, no optimization
"Release", -- optimized build with asserts and debug drawing and UI on
"ReleaseAsan", -- same as Release except ASAN is enabled
"Profile", -- optimized build without asserts and debug drawing, debug UI present
"Retail" -- optimized build without all of the debug stuff
}
defines {
"PROJECT_COMPILE_CONFIGURATION=%{cfg.buildcfg}",
"PROJECT_COMPILE_PLATFORM=%{cfg.platform}"
}
filter {}
-- setup VSCode generator settings
vscode_makefile "build"
vscode_launch_cwd ("${workspaceRoot}/../build/bin64linux")
vscode_launch_environment {
LD_LIBRARY_PATH = "${LD_LIBRARY_PATH}:${workspaceRoot}/%{cfg.targetdir}:${workspaceRoot}/../build/bin64linux"
}
vscode_launch_visualizerFile "${workspaceRoot}/public/types.natvis"
PUBLIC_DIR = ENGINE_DIR.."/public"
FRAMEWORK_DIR = ENGINE_DIR.."/framework"
SHARED_DIR = ENGINE_DIR.."/shared"
-- properties
usage "public"
includedirs {
PUBLIC_DIR,
FRAMEWORK_DIR
}
usage "shared"
includedirs {
SHARED_DIR
}
include(ENGINE_DIR.."/src_dependency")
include(ENGINE_DIR.."/framework")
include(ENGINE_DIR.."/core")
include(ENGINE_DIR.."/shared")
group ""
-- only build tools for big machines
if ENABLE_TOOLS then
include(ENGINE_DIR.."/tools")
end