forked from rive-app/rive-runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpremake5_v2.lua
More file actions
164 lines (141 loc) · 3.81 KB
/
premake5_v2.lua
File metadata and controls
164 lines (141 loc) · 3.81 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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
dofile('rive_build_config.lua')
filter({ 'options:with_rive_tools' })
do
defines({ 'WITH_RIVE_TOOLS' })
end
filter({ 'options:with_rive_text' })
do
defines({ 'WITH_RIVE_TEXT' })
end
filter({ 'options:with_rive_scripting' })
do
defines({ 'WITH_RIVE_SCRIPTING' })
end
filter({ 'options:with_rive_audio=system' })
do
defines({ 'WITH_RIVE_AUDIO', 'MA_NO_RESOURCE_MANAGER' })
end
filter({ 'options:with_rive_audio=external' })
do
defines({
'WITH_RIVE_AUDIO',
'EXTERNAL_RIVE_AUDIO_ENGINE',
'MA_NO_DEVICE_IO',
'MA_NO_RESOURCE_MANAGER',
})
end
filter({ 'options:with_rive_layout' })
do
defines({ 'WITH_RIVE_LAYOUT' })
end
filter({})
dependencies = path.getabsolute('dependencies/')
dofile(path.join(dependencies, 'premake5_harfbuzz_v2.lua'))
dofile(path.join(dependencies, 'premake5_sheenbidi_v2.lua'))
dofile(path.join(dependencies, 'premake5_miniaudio_v2.lua'))
dofile(path.join(dependencies, 'premake5_yoga_v2.lua'))
if _OPTIONS['with_optick'] then
dofile(path.join(dependencies, 'premake5_optick.lua'))
end
if _OPTIONS['with_rive_scripting'] then
luau = require(path.join(path.getabsolute('scripting/'), 'premake5')).luau
else
luau = ''
end
project('rive')
do
kind('StaticLib')
includedirs({
'include',
harfbuzz .. '/src',
sheenbidi .. '/Headers',
miniaudio,
yoga,
})
filter('action:xcode4')
do
-- xcode doesnt like angle brackets except for -isystem
-- should use externalincludedirs but GitHub runners dont have latest premake5 binaries
buildoptions({ '-isystem' .. yoga })
end
filter({})
defines({ 'YOGA_EXPORT=', '_RIVE_INTERNAL_' })
files({ 'src/**.cpp', 'include/**.h', 'include/**.hpp' })
filter('options:not for_unreal')
do
cppdialect('C++11')
fatalwarnings({ 'All' })
end
filter({ 'options:for_unreal' })
do
cppdialect('C++17')
defines({ '_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR' })
end
filter({ 'options:with_rive_text', 'options:not no-harfbuzz-renames' })
do
includedirs({
dependencies,
})
forceincludes({ 'rive_harfbuzz_renames.h' })
end
filter({ 'options:not no-yoga-renames' })
do
includedirs({
dependencies,
})
forceincludes({ 'rive_yoga_renames.h' })
end
filter({ 'system:macosx', 'options:variant=runtime' })
do
buildoptions({
'-Wimplicit-float-conversion -fembed-bitcode -arch arm64 -arch x86_64 -isysroot '
.. (os.getenv('MACOS_SYSROOT') or ''),
})
end
filter('system:windows')
do
architecture('x64')
defines({ '_USE_MATH_DEFINES' })
end
if _OPTIONS['with_optick'] then
includedirs({ optick .. '/src' })
end
filter('system:macosx or system:ios')
do
files({ 'src/text/font_hb_apple.mm' })
end
if TESTING == true then
filter({ 'toolset:not msc' })
do
buildoptions({ '-Wshorten-64-to-32', '-fprofile-instr-generate', '-fcoverage-mapping' })
end
end
filter({ 'options:with_rive_scripting' })
do
includedirs({
luau .. '/VM/include',
})
end
end
newoption({
trigger = 'with_rive_tools',
description = 'Enables tools usually not necessary for runtime.',
})
newoption({
trigger = 'with_rive_scripting',
description = 'Enables scripting for the runtime.',
})
newoption({
trigger = 'with_rive_text',
description = 'Compiles in text features.',
})
newoption({
trigger = 'with_rive_audio',
value = 'disabled',
description = 'The audio mode to use.',
allowed = { { 'disabled' }, { 'system' }, { 'external' } },
})
newoption({
trigger = 'with_rive_layout',
description = 'Compiles in layout features.',
})