From 672a1d022c3aa36151c7b723b0c65e204980c202 Mon Sep 17 00:00:00 2001 From: Amir Masoud Abdol Date: Tue, 9 May 2023 14:37:33 +0200 Subject: [PATCH] Implement qt_internal_get_file_path_mode for changing the file path mode In cases where we allow symlink, we need to use ABSOLUTE path, and don't resolve the symlink. This function returns ABSOLUTE only if we are on Apple platform, and have QT_ALLOW_SYMLINK_IN_PATHS enabled. While this is mainly to resolve the issue report by Homebrew, it might be useful if a user really want to build with symlink. Pick-to: 6.5 Task-number: QTBUG-113463 Change-Id: Ided141ed8de66cc1d3717ec2719eb703fa7fc589 Reviewed-by: Alexey Edelev --- .../QtBuildInternalsConfig.cmake | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake b/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake index 4532cbe9280..e4876332106 100644 --- a/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake +++ b/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake @@ -1435,3 +1435,19 @@ function(qt_internal_run_common_config_tests) qt_internal_check_cmp0099_available() qt_configure_end_summary_section() endfunction() + +# It is used in QtWebEngine to replace the REALPATH with ABSOLUTE path, which is +# useful for building Qt in Homebrew. +function(qt_internal_get_filename_path_mode out_var) + set(mode REALPATH) + if(APPLE AND QT_ALLOW_SYMLINK_IN_PATHS) + set(mode ABSOLUTE) + message(WARNING + "QT_ALLOW_SYMLINK_IN_PATHS is enabled. " + "This is not recommended, and it may lead to unexpected issues. " + "E.g., When building QtWebEngine, enabling this option may result in build " + "issues in certain platforms. See https://bugreports.qt.io/browse/QTBUG-59769." + ) + endif() + set(${out_var} ${mode} PARENT_SCOPE) +endfunction()