@@ -238,6 +238,13 @@ def PositiveInt(string):
238
238
help = "Print the corresponding CMake command and quit"
239
239
)
240
240
241
+ parser .add_argument (
242
+ '--vcpkg' ,
243
+ nargs = '?' ,
244
+ const = '{}/scripts/buildsystems/vcpkg.cmake' .format (os .environ ['VCPKG_ROOT' ]),
245
+ help = 'Enables vcpkg using $VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake or given argument'
246
+ )
247
+
241
248
args = parser .parse_args ()
242
249
243
250
polly_toolchain = detail .toolchain_name .get (args .toolchain )
@@ -296,7 +303,6 @@ def PositiveInt(string):
296
303
toolchain_path = os .path .join (polly_root , "{}.cmake" .format (polly_toolchain ))
297
304
if not os .path .exists (toolchain_path ):
298
305
sys .exit ("Toolchain file not found: {}" .format (toolchain_path ))
299
- toolchain_option = "-DCMAKE_TOOLCHAIN_FILE={}" .format (toolchain_path )
300
306
301
307
if args .output :
302
308
if not os .path .isdir (args .output ):
@@ -309,7 +315,6 @@ def PositiveInt(string):
309
315
310
316
build_dir = os .path .join (cdir , '_builds' , build_tag )
311
317
print ("Build dir: {}" .format (build_dir ))
312
- build_dir_option = "-B{}" .format (build_dir )
313
318
314
319
install_dir = os .path .join (cdir , '_install' , polly_toolchain )
315
320
local_install = args .install or args .strip or args .framework or args .framework_device or args .archive
@@ -380,9 +385,13 @@ def PositiveInt(string):
380
385
generate_command = [
381
386
cmake_bin ,
382
387
'-H{}' .format (home ),
383
- build_dir_option
388
+ '-B{}' .format (build_dir ),
389
+ '-DCMAKE_TOOLCHAIN_FILE={}' .format (args .vcpkg if args .vcpkg else toolchain_path )
384
390
]
385
391
392
+ if args .vcpkg :
393
+ generate_command .append ('-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE={}' .format (toolchain_path ))
394
+
386
395
if args .cache :
387
396
if not os .path .isfile (args .cache ):
388
397
sys .exit ("Specified cache file does not exist: {}" .format (args .cache ))
@@ -403,9 +412,6 @@ def PositiveInt(string):
403
412
toolset = 'v{}0_xp' .format (toolchain_entry .vs_version )
404
413
generate_command .append ('-T{}' .format (toolset ))
405
414
406
- if toolchain_option :
407
- generate_command .append (toolchain_option )
408
-
409
415
if args .verbosity == 'full' :
410
416
generate_command .append ('-DCMAKE_VERBOSE_MAKEFILE=ON' )
411
417
generate_command .append ('-DPOLLY_STATUS_DEBUG=ON' )
0 commit comments