pro2cmake: Don't generate GUI applications for config.tests

On macOS the config.tests executable should not be a bundle,
and on Windows it should be a subsystem console application.

Change-Id: I2c8078cc9537df42683f3ff3bcce409402824555
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
This commit is contained in:
Alexandru Croitor 2019-09-24 10:57:54 +02:00
parent 1d5e8996b0
commit 0441e3743e

View File

@ -3296,14 +3296,8 @@ def handle_config_test_project(scope: Scope, cm_fh: IO[str]):
# Remove default QT libs. # Remove default QT libs.
scope._append_operation("QT", RemoveOperation(["core", "gui"])) scope._append_operation("QT", RemoveOperation(["core", "gui"]))
config = scope.get("CONFIG")
gui = all(val not in config for val in ["console", "cmdline"])
add_target = f"add_executable(${{PROJECT_NAME}}" add_target = f"add_executable(${{PROJECT_NAME}}"
if gui:
add_target += " WIN32 MACOSX_BUNDLE"
temp_buffer = io.StringIO() temp_buffer = io.StringIO()
write_all_source_file_lists(temp_buffer, scope, add_target, indent=0) write_all_source_file_lists(temp_buffer, scope, add_target, indent=0)
buffer_value = temp_buffer.getvalue() buffer_value = temp_buffer.getvalue()