summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@qt.io>2024-02-22 19:53:48 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2024-03-05 02:48:22 +0000
commit97a92eb0345b6931bd3f7079d3818de4e6eedb9e (patch)
tree37bcbc778e32c4028390e96706720581124967ad
parent32f9825efa201b85676afc75f683f2415e1e22c2 (diff)
CMake/Windows: add setlocal to the Windows bat files
Several of the cmake bat files sets "script_dir_path". The problem is that those assignments are not local to the script files. E.g when qt-configure-module.bat gives it a value, and then call qt-cmake.bat, qt-cmake.bat will assign it a different value. And this value will overwrite the original value in qt-configure-module.bat. So when the call returns, that script can sometimes fail. This happens (for unknown reasons) if the Qt source code path contains a link to a different drive, created with mklink /d. This is typical if Windows is running in a virtual machine, and the Qt source code is shared with the host on e.g drive Q:. In that case you might want to a folder on C: be a symlink to Q:, in order to build Qt. This patch will make sure we add "setlocal" in all the affected bat files, so that any changes done to e.g "script_dir_path" stays local to each file. Pick-to: 6.5 Change-Id: Iee18e06eb0beece0c85c4345d9bfc0194e466e56 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 458be44aebd441884502798c569cfcdfb06d15a9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit ad98a3bc729e002453537f6f036fcbe41aea2790)
-rw-r--r--bin/qt-cmake-create.bat.in1
-rw-r--r--bin/qt-cmake.bat.in1
2 files changed, 2 insertions, 0 deletions
diff --git a/bin/qt-cmake-create.bat.in b/bin/qt-cmake-create.bat.in
index ff8f7310e9..97faad8db7 100644
--- a/bin/qt-cmake-create.bat.in
+++ b/bin/qt-cmake-create.bat.in
@@ -1,4 +1,5 @@
@echo off
+setlocal
:: The directory of this script is the expanded absolute path of the "$qt_prefix/bin" directory.
set script_dir_path=%~dp0
diff --git a/bin/qt-cmake.bat.in b/bin/qt-cmake.bat.in
index 96d955d2a9..5d831ebce9 100644
--- a/bin/qt-cmake.bat.in
+++ b/bin/qt-cmake.bat.in
@@ -1,4 +1,5 @@
@echo off
+setlocal
:: The directory of this script is the expanded absolute path of the "$qt_prefix/bin" directory.
set script_dir_path=%~dp0