Skip to content

Commit

Permalink
CMake: add an option to enable or disable versioned hard link
Browse files Browse the repository at this point in the history
The option is called QT_CREATE_VERSIONED_HARD_LINK. By default, it
is set to ON. Users can set this option to OFF to disable versioned
hard link.

Pick-to: 6.1
Fixes: QTBUG-93636
Change-Id: I0ffa1ee1c6bae1950df332fcce3152a861b33db0
Reviewed-by: Alexandru Croitor <[email protected]>
  • Loading branch information
lixinwei715 committed May 12, 2021
1 parent 6e04664 commit 320c282
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ if(NOT QT_BUILD_STANDALONE_TESTS)
## Should this Qt be built with Werror?
option(WARNINGS_ARE_ERRORS "Build Qt with warnings as errors" ${FEATURE_developer_build})

## Should this Qt create versioned hard link for some tools?
option(QT_CREATE_VERSIONED_HARD_LINK "Enable the use of versioned hard link" ON)

## QtBase specific configure tests:
include(QtBaseConfigureTests)

Expand Down
4 changes: 4 additions & 0 deletions cmake/QtBuildInternalsExtra.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,9 @@ set(QT_BUILD_EXAMPLES_BY_DEFAULT @QT_BUILD_EXAMPLES_BY_DEFAULT@ CACHE BOOL
# Propagate usage of ccache.
set(QT_USE_CCACHE @QT_USE_CCACHE@ CACHE BOOL "Enable the use of ccache")

# Propagate usage of versioned hard link.
set(QT_CREATE_VERSIONED_HARD_LINK "@QT_CREATE_VERSIONED_HARD_LINK@" CACHE BOOL
"Enable the use of versioned hard link")

# Extra set of exported variables
@QT_EXTRA_BUILD_INTERNALS_VARS@
4 changes: 4 additions & 0 deletions cmake/QtInstallHelpers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,10 @@ function(qt_internal_install_versioned_link install_dir target)
return()
endif()

if(NOT QT_CREATE_VERSIONED_HARD_LINK)
return()
endif()

qt_path_join(install_base_file_path "$\{qt_full_install_prefix}"
"${install_dir}" "$<TARGET_FILE_BASE_NAME:${target}>")
set(original "${install_base_file_path}$<TARGET_FILE_SUFFIX:${target}>")
Expand Down

0 comments on commit 320c282

Please sign in to comment.