summaryrefslogtreecommitdiffstats
path: root/util/cmake/helper.py
diff options
context:
space:
mode:
authorLeander Beernaert <leander.beernaert@qt.io>2020-03-04 13:44:24 +0100
committerLeander Beernaert <leander.beernaert@qt.io>2020-03-06 12:32:48 +0100
commit8ffb9053ad300b1fc00b2dd4e808c99d03a3d7a4 (patch)
tree31ad95ba45cfe0abb1237eebbf7cc6b29f92da9b /util/cmake/helper.py
parent8bdbb7f2267516905531f719902168c036329646 (diff)
Handle configure.json library tests
This patch updates configurejson2cmake.py to generate compile tests for library entries. The test also support the inherit keyword, which is currently limited to one level of inheritance. LibraryMapping has been extended with a test_library_overwrite as a means to overwrite the mapped library during a compile test. Certain tests such as openssl_headers form src/network are mapped with *_nolink libraries which do not exist when the test is run. Failing to do so will cause the test to run as it is skipped when the library target isn't found. To avoid redundant checks, the library tests need to be opt in by setting run_library_test to True on an instance of LibraryMapping. Change-Id: I607b24eda389fa67afad301c616e31bb7ab38d20 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'util/cmake/helper.py')
-rw-r--r--util/cmake/helper.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/util/cmake/helper.py b/util/cmake/helper.py
index 9b9f347fff..bac0bdb725 100644
--- a/util/cmake/helper.py
+++ b/util/cmake/helper.py
@@ -42,6 +42,8 @@ class LibraryMapping:
appendFoundSuffix: bool = True,
emit_if: str = "",
is_bundled_with_qt: bool = False,
+ test_library_overwrite: str = "",
+ run_library_test: bool = False
) -> None:
self.soName = soName
self.packageName = packageName
@@ -57,6 +59,13 @@ class LibraryMapping:
# for a library will be surrounded by this condition.
self.emit_if = emit_if
+ # Allow overwriting library name when used with tests. E.g.: _nolink
+ # targets do not exist when used during compile tests
+ self.test_library_overwrite = test_library_overwrite
+
+ # Run the library compile test of configure.json
+ self.run_library_test = run_library_test
+
def is_qt(self) -> bool:
return self.packageName == "Qt" or self.packageName == "Qt5" or self.packageName == "Qt6"
@@ -437,10 +446,12 @@ _library_map = [
"openssl_headers",
"OpenSSL",
"OpenSSL::SSL_nolink",
- resultVariable="OPENSSL_INCLUDE_DIR",
+ resultVariable="TEST_openssl_headers",
appendFoundSuffix=False,
+ test_library_overwrite = "OpenSSL::SSL",
+ run_library_test=True
),
- LibraryMapping("openssl", "OpenSSL", "OpenSSL::SSL"),
+ LibraryMapping("openssl", "OpenSSL", "OpenSSL::SSL", resultVariable="TEST_openssl", appendFoundSuffix=False, run_library_test=True),
LibraryMapping("oci", "Oracle", "Oracle::OCI"),
LibraryMapping(
"pcre2", "WrapPCRE2", "WrapPCRE2::WrapPCRE2", extra=["REQUIRED"], is_bundled_with_qt=True