Skip to content

Commit

Permalink
Add drive letter to source paths when calling qt-internal- scripts
Browse files Browse the repository at this point in the history
Like qt-configure-module.bat, when building with unity build, CMake
needs to know the full path of the source directory to be able to
correctly generate its `*_cxx.cxx` files. So far, this seems to only
affect Windows' LLVM/MinGW builds. By this patch, I make sure that we
pass the full path to CMake.

Pick-to: 6.5
Task-number: QTBUG-109394
Change-Id: Ida2da127ecba95856b6e0091936c471c2a116936
Reviewed-by: Alexandru Croitor <[email protected]>
  • Loading branch information
amirmasoudabdol committed Apr 14, 2023
1 parent 38d56e2 commit 389b3a1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ else()
set(absolute_project_path "${QT_STANDALONE_TEST_PATH}")
endif()

# If path does not include the drive letter, we try to add it.
get_filename_component(absolute_project_path "." REALPATH BASE_DIR "${absolute_project_path}")

if(NOT IS_DIRECTORY "${absolute_project_path}")
get_filename_component(filename "${absolute_project_path}" NAME)
get_filename_component(directory "${absolute_project_path}" DIRECTORY)
Expand Down
9 changes: 8 additions & 1 deletion libexec/qt-internal-configure-tests.bat.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ setlocal ENABLEDELAYEDEXPANSION ENABLEEXTENSIONS
set script_dir_path=%~dp0
set script_dir_path=%script_dir_path:~0,-1%

rem add the drive letter to the source_dir_path,
rem by removing the path argument, expanding it, and adding it back
set source_dir_path=%~dpnx1
set args=%*
set args=%args:* =%
set args=%source_dir_path% %args%

set cmake_scripts_dir=%script_dir_path%

set relative_bin_dir=@relative_path_from_libexec_dir_to_bin_dir@
Expand All @@ -11,4 +18,4 @@ set relative_bin_dir="%relative_bin_dir%"\
)

call "%script_dir_path%"\%relative_bin_dir%"qt-cmake.bat" ^
@script_passed_args@ %*
@script_passed_args@ %args%

0 comments on commit 389b3a1

Please sign in to comment.