Skip to content

Commit

Permalink
Add OS-specific prelude to qt-cmake-standalone-test
Browse files Browse the repository at this point in the history
This makes sure the executable is run as a shell script
with the proper interpreter on Unix systems.
Otherwise it will fail in some shells, like fish.

On windows, it prevents all commands in the batch file
from displaying on the screen.

Change-Id: If554262f172b035b9661b3e2ff26a96789fa707b
Reviewed-by: Alexandru Croitor <[email protected]>
  • Loading branch information
karjonas authored and alcroito committed Jul 15, 2020
1 parent 1245908 commit a99bc30
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions bin/qt-cmake-standalone-test.in
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
@__qt_cmake_standalone_test_os_prelude@

@__qt_cmake_private_path@ @__qt_cmake_standalone_test_path@ -DQT_STANDALONE_TEST_PATH=@__qt_cmake_standalone_passed_args@
2 changes: 2 additions & 0 deletions cmake/QtBaseGlobalTargets.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -239,9 +239,11 @@ if(QT_WILL_INSTALL)
"${__qt_cmake_standalone_test_path}")
endif()
if(UNIX)
set(__qt_cmake_standalone_test_os_prelude "#!/bin/sh")
string(PREPEND __qt_cmake_private_path "exec ")
set(__qt_cmake_standalone_passed_args "\"$@\" -DPWD=\"$PWD\"")
else()
set(__qt_cmake_standalone_test_os_prelude "@echo off")
string(APPEND __qt_cmake_standalone_test_bin_name ".bat")
string(APPEND __qt_cmake_private_path ".bat")
set(__qt_cmake_standalone_passed_args "%* -DPWD=\"%CD%\"")
Expand Down

0 comments on commit a99bc30

Please sign in to comment.