forked from qt/qtbase
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CMake: Fix argument passing for configure.bat / qt-configure-module.bat
Passing arguments with equal signs was broken for configure.bat and qt-configure-module.bat. An argument FOO=BAR was split at = and written as FOO BAR to config.opt, breaking every attempt of assigning CMake variables. We must not iterate over %* in batch files to avoid splitting arguments at equal signs. Instead, pass %* unmodified to a CMake script that writes config.opt. Fixes: QTBUG-88019 Change-Id: I7c743a206961d1ed168f2313f864905f6b345b49 Reviewed-by: Alexandru Croitor <[email protected]>
- Loading branch information
Showing
4 changed files
with
35 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# This script writes its arguments to the file determined by OUT_FILE. | ||
# Each argument appears on a separate line. | ||
# This is used for writing the config.opt file. | ||
# | ||
# This script takes the following arguments: | ||
# OUT_FILE: The output file. | ||
# SKIP_ARGS: Number of arguments to skip from the front of the arguments list. | ||
|
||
# Look for the -P argument to determine the start of the actual script arguments | ||
math(EXPR stop "${CMAKE_ARGC} - 1") | ||
set(start 0) | ||
foreach(i RANGE 1 ${stop}) | ||
if(CMAKE_ARGV${i} STREQUAL "-P") | ||
math(EXPR start "${i} + 2") | ||
break() | ||
endif() | ||
endforeach() | ||
|
||
# Skip arguments if requested | ||
if(DEFINED SKIP_ARGS) | ||
math(EXPR start "${start} + ${SKIP_ARGS}") | ||
endif() | ||
|
||
# Write config.opt | ||
set(content "") | ||
if(start LESS_EQUAL stop) | ||
foreach(i RANGE ${start} ${stop}) | ||
string(APPEND content "${CMAKE_ARGV${i}}\n") | ||
endforeach() | ||
endif() | ||
file(WRITE "${OUT_FILE}" "${content}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters