@@ -76,7 +76,14 @@ def unity():
76
76
@click .pass_context
77
77
def for_unity (ctx ):
78
78
""" build just dynamic libs for use in unity project """
79
- ctx .invoke (libs , clean = False , static = False , shared = True , skip_formatter = False )
79
+ ctx .invoke (
80
+ libs ,
81
+ clean = False ,
82
+ static = False ,
83
+ shared = True ,
84
+ skip_formatter = True ,
85
+ just_release = True
86
+ )
80
87
81
88
82
89
@cli .command ()
@@ -85,7 +92,7 @@ def unreal():
85
92
pass
86
93
87
94
88
- def build_lib (build_name , generator , options ):
95
+ def build_lib (build_name , generator , options , just_release ):
89
96
""" Create a dir under builds, run build and install in it """
90
97
build_path = os .path .join (SCRIPT_PATH , 'builds' , build_name )
91
98
install_path = os .path .join (INSTALL_ROOT , build_name )
@@ -99,17 +106,14 @@ def build_lib(build_name, generator, options):
99
106
]
100
107
if generator :
101
108
initial_cmake .extend (['-G' , generator ])
102
- if IS_BUILD_MACHINE :
103
- # disable formatting on CI builds
104
- initial_cmake .append ('-DCLANG_FORMAT_SUFFIX=none' )
105
109
for key in options :
106
110
val = options [key ]
107
111
if type (val ) is bool :
108
112
val = 'ON' if val else 'OFF'
109
113
initial_cmake .append ('-D%s=%s' % (key , val ))
110
114
click .echo ('--- Building ' + build_name )
111
115
subprocess .check_call (initial_cmake )
112
- if not IS_BUILD_MACHINE :
116
+ if not just_release :
113
117
subprocess .check_call (['cmake' , '--build' , '.' , '--config' , 'Debug' ])
114
118
subprocess .check_call (['cmake' , '--build' , '.' , '--config' , 'Release' , '--target' , 'install' ])
115
119
@@ -179,7 +183,8 @@ def sign():
179
183
@click .option ('--static' , is_flag = True )
180
184
@click .option ('--shared' , is_flag = True )
181
185
@click .option ('--skip_formatter' , is_flag = True )
182
- def libs (clean , static , shared , skip_formatter ):
186
+ @click .option ('--just_release' , is_flag = True )
187
+ def libs (clean , static , shared , skip_formatter , just_release ):
183
188
""" Do all the builds for this platform """
184
189
if clean :
185
190
shutil .rmtree ('builds' , ignore_errors = True )
@@ -196,29 +201,32 @@ def libs(clean, static, shared, skip_formatter):
196
201
'USE_STATIC_CRT' : True ,
197
202
}
198
203
199
- if skip_formatter :
200
- static_options ['CLANG_FORMAT_SUFFIX' ] = 'nope'
201
- dynamic_options ['CLANG_FORMAT_SUFFIX' ] = 'nope'
204
+ if skip_formatter or IS_BUILD_MACHINE :
205
+ static_options ['CLANG_FORMAT_SUFFIX' ] = 'none'
206
+ dynamic_options ['CLANG_FORMAT_SUFFIX' ] = 'none'
207
+
208
+ if IS_BUILD_MACHINE :
209
+ just_release = True
202
210
203
211
if PLATFORM == 'win' :
204
212
generator32 = 'Visual Studio 14 2015'
205
213
generator64 = 'Visual Studio 14 2015 Win64'
206
214
if static :
207
- build_lib ('win32-static' , generator32 , static_options )
208
- build_lib ('win64-static' , generator64 , static_options )
215
+ build_lib ('win32-static' , generator32 , static_options , just_release )
216
+ build_lib ('win64-static' , generator64 , static_options , just_release )
209
217
if shared :
210
- build_lib ('win32-dynamic' , generator32 , dynamic_options )
211
- build_lib ('win64-dynamic' , generator64 , dynamic_options )
218
+ build_lib ('win32-dynamic' , generator32 , dynamic_options , just_release )
219
+ build_lib ('win64-dynamic' , generator64 , dynamic_options , just_release )
212
220
elif PLATFORM == 'osx' :
213
221
if static :
214
- build_lib ('osx-static' , None , static_options )
222
+ build_lib ('osx-static' , None , static_options , just_release )
215
223
if shared :
216
- build_lib ('osx-dynamic' , None , dynamic_options )
224
+ build_lib ('osx-dynamic' , None , dynamic_options , just_release )
217
225
elif PLATFORM == 'linux' :
218
226
if static :
219
- build_lib ('linux-static' , None , static_options )
227
+ build_lib ('linux-static' , None , static_options , just_release )
220
228
if shared :
221
- build_lib ('linux-dynamic' , None , dynamic_options )
229
+ build_lib ('linux-dynamic' , None , dynamic_options , just_release )
222
230
223
231
224
232
if __name__ == '__main__' :
0 commit comments