diff options
author | Tobias Hunger <tobias.hunger@qt.io> | 2019-03-28 15:25:17 +0100 |
---|---|---|
committer | Tobias Hunger <tobias.hunger@qt.io> | 2019-04-10 09:36:40 +0000 |
commit | 92b0d7b9110dde7db56f10d7c34a21876fb27fe3 (patch) | |
tree | c232918e84cf0ee74bf4352f7b47135ff0f4e0dd /util | |
parent | be0cf9f8d7bb23936301eadd2af1e4172d1b9f0e (diff) |
CMake: Support /nolink libraries
Add a helper function to QtBuild that generates Foo_nolink versions
of Foo library targets.
Map 'Foo/nolink' libs found in qmake to Foo_nolink.
Automatically run helper function to create _nolink targets as
part of extend_target.
Change-Id: I4c23ea68b3037d23c9a31d4ac272a6bd0565f7c0
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'util')
-rw-r--r-- | util/cmake/helper.py | 7 | ||||
-rwxr-xr-x | util/cmake/pro2cmake.py | 2 |
2 files changed, 7 insertions, 2 deletions
diff --git a/util/cmake/helper.py b/util/cmake/helper.py index f5573c3fac..9de01df32f 100644 --- a/util/cmake/helper.py +++ b/util/cmake/helper.py @@ -232,6 +232,7 @@ libray_mapping = { 'libudev': 'PkgConfig::Libudev', 'mtdev': 'PkgConfig::Mtdev', 'odbc': 'ODBC::ODBC', + 'openssl': 'OpenSSL::SSL', 'pcre2': 'PCRE2', 'psql': 'PostgreSQL::PostgreSQL', 'sqlite': 'SQLite::SQLite3', @@ -263,4 +264,8 @@ libray_mapping = { def substitute_libs(lib: str) -> str: - return libray_mapping.get(lib, lib) + libpostfix = '' + if lib.endswith('/nolink'): + lib = lib[:-7] + libpostfix = '_nolink' + return libray_mapping.get(lib, lib) + libpostfix diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 9399be5f33..7f4af835ff 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -1012,7 +1012,7 @@ def write_sources_section(cm_fh: typing.IO[str], scope: Scope, *, write_library_section(cm_fh, scope, ['QMAKE_USE', 'LIBS'], - ['QT_FOR_PRIVATE', 'QMAKE_USE_PRIVATE', 'LIBS_PRIVATE'], + ['QT_FOR_PRIVATE', 'QMAKE_USE_PRIVATE', 'QMAKE_USE_FOR_PRIVATE', 'LIBS_PRIVATE'], ['QT',], indent=indent, known_libraries=known_libraries) |