From e93810d2ef7633e374992006af89f2b5056b04f1 Mon Sep 17 00:00:00 2001 From: Sander Cox Date: Tue, 20 Oct 2020 04:52:36 +0200 Subject: [CMake] VCPKG_APPLOCAL_DEPS sometimes causes conflicts when processing multiple files in the same directory (#13025) Co-authored-by: Robert Schumacher --- scripts/buildsystems/vcpkg.cmake | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'scripts') diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index 00e6645fa..7e6d5408a 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -394,6 +394,7 @@ if(VCPKG_MANIFEST_MODE AND VCPKG_MANIFEST_INSTALL AND NOT _CMAKE_IN_TRY_COMPILE) endif() option(VCPKG_APPLOCAL_DEPS "Automatically copy dependencies into the output directory for executables." ON) +option(X_VCPKG_APPLOCAL_DEPS_SERIALIZED "(experimental) Add USES_TERMINAL to VCPKG_APPLOCAL_DEPS to force serialization." OFF) function(add_executable name) _add_executable(${ARGV}) list(FIND ARGV "IMPORTED" IMPORTED_IDX) @@ -402,11 +403,16 @@ function(add_executable name) if(IMPORTED_IDX EQUAL -1 AND ALIAS_IDX EQUAL -1) if(VCPKG_APPLOCAL_DEPS) if(_VCPKG_TARGET_TRIPLET_PLAT MATCHES "windows|uwp") + set(EXTRA_OPTIONS "") + if(X_VCPKG_APPLOCAL_DEPS_SERIALIZED) + set(EXTRA_OPTIONS USES_TERMINAL) + endif() add_custom_command(TARGET ${name} POST_BUILD COMMAND powershell -noprofile -executionpolicy Bypass -file ${_VCPKG_TOOLCHAIN_DIR}/msbuild/applocal.ps1 -targetBinary $ -installedDir "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}$<$:/debug>/bin" -OutVariable out + ${EXTRA_OPTIONS} ) elseif(_VCPKG_TARGET_TRIPLET_PLAT MATCHES "osx") if (NOT MACOSX_BUNDLE_IDX EQUAL -1) -- cgit v1.2.3