Skip to content

Commit

Permalink
CMake: Fix QMAKE_LIB of WrapOpenSSLHeaders library
Browse files Browse the repository at this point in the history
The correct entry for this lib is 'openssl/nolink', not
'openssl_headers'.

In configurejson2cmake's helper.py we already have
this information encoded such that the no_link_so_name field of
'openssl' points to 'openssl_headers'. Extend configurejson2cmake to
take this into account, and re-generate src/network/configure.cmake.

Pick-to: 6.0
Change-Id: I9817ea7722503a373d309b7e6fa201448d403e8d
Reviewed-by: Alexandru Croitor <[email protected]>
  • Loading branch information
jobor committed Nov 30, 2020
1 parent b71c043 commit 5592204
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .prev_configure.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@ qt_feature("enable_gdb_index"
qt_feature_config("enable_gdb_index" QMAKE_PRIVATE_CONFIG)
qt_feature("reduce_exports" PRIVATE
LABEL "Reduce amount of exported symbols"
CONDITION NOT WIN32 AND CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY
CONDITION NOT MSVC
)
qt_feature_definition("reduce_exports" "QT_VISIBILITY_AVAILABLE")
qt_feature_config("reduce_exports" QMAKE_PUBLIC_QT_CONFIG)
Expand Down
2 changes: 1 addition & 1 deletion src/network/configure.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

qt_find_package(WrapBrotli PROVIDED_TARGETS WrapBrotli::WrapBrotliDec MODULE_NAME network QMAKE_LIB brotli)
qt_find_package(Libproxy PROVIDED_TARGETS PkgConfig::Libproxy MODULE_NAME network QMAKE_LIB libproxy)
qt_find_package(WrapOpenSSLHeaders PROVIDED_TARGETS WrapOpenSSLHeaders::WrapOpenSSLHeaders MODULE_NAME network QMAKE_LIB openssl_headers)
qt_find_package(WrapOpenSSLHeaders PROVIDED_TARGETS WrapOpenSSLHeaders::WrapOpenSSLHeaders MODULE_NAME network QMAKE_LIB openssl/nolink)
# openssl_headers
qt_config_compile_test(openssl_headers
LIBRARIES
Expand Down
11 changes: 10 additions & 1 deletion util/cmake/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -661,6 +661,15 @@ def find_library_info_for_target(targetName: str) -> typing.Optional[LibraryMapp
return None


# For a given qmake library (e.g. 'openssl_headers'), check whether this is a fake library used
# for the /nolink annotation, and return the actual annotated qmake library ('openssl/nolink').
def find_annotated_qmake_lib_name(lib : str) -> str:
for entry in _library_map:
if entry.no_link_so_name == lib:
return entry.soName + "/nolink"
return lib


def featureName(name: str) -> str:
replacement_char = "_"
if name.startswith("c++"):
Expand Down Expand Up @@ -813,7 +822,7 @@ def generate_find_package_info(
extra += ["PROVIDED_TARGETS", cmake_target_name]
if module:
extra += ["MODULE_NAME", module]
extra += ["QMAKE_LIB", lib.soName]
extra += ["QMAKE_LIB", find_annotated_qmake_lib_name(lib.soName)]

result = ""
one_ind = " "
Expand Down

0 comments on commit 5592204

Please sign in to comment.