summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeander Beernaert <leander.beernaert@qt.io>2019-10-21 14:32:07 +0200
committerLeander Beernaert <leander.beernaert@qt.io>2019-10-21 14:36:35 +0000
commit58964af094e836af94dde6673512d4dbe61d6f34 (patch)
tree5018851c702df9fff2d63aeb994ce11d5ea5cc34
parentedf61092f2da45618fd8f983a5609523b204c004 (diff)
Handle Library dependencies in compile tests
Update configurejson2cmake.py to also write out the libraries compile tests depend on. Change-Id: I22dbc227a33b9b5d39a2198c6ee6062e7e1bf3de Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
-rwxr-xr-xutil/cmake/configurejson2cmake.py31
1 files changed, 21 insertions, 10 deletions
diff --git a/util/cmake/configurejson2cmake.py b/util/cmake/configurejson2cmake.py
index ba6c85af28..0b91a8befd 100755
--- a/util/cmake/configurejson2cmake.py
+++ b/util/cmake/configurejson2cmake.py
@@ -593,20 +593,31 @@ endif()
else:
qmakeFixme = f"# FIXME: qmake: {details['qmake']}\n"
+ library_list = []
if "use" in data:
- if data["use"] == "egl xcb_xlib":
- librariesCmakeName = format(featureName(test)) + "_TEST_LIBRARIES"
- cm_fh.write("if (HAVE_EGL AND X11_XCB_FOUND AND X11_FOUND)\n")
- cm_fh.write(" set(" + librariesCmakeName + " EGL::EGL X11::X11 X11::XCB)\n")
- cm_fh.write("endif()\n")
- else:
- qmakeFixme += f"# FIXME: use: {data['use']}\n"
+ for library in data["use"].split(" "):
+ if len(library) == 0:
+ continue
+
+ mapped_library = find_3rd_party_library_mapping(library)
+ if not mapped_library:
+ qmakeFixme += f"# FIXME: use: unmapped library: {library}\n"
+ continue
+ library_list.append(mapped_library.targetName)
+
+
cm_fh.write(f"qt_config_compile_test({featureName(test)}\n")
cm_fh.write(lineify("LABEL", data.get("label", "")))
- if librariesCmakeName != "":
- cm_fh.write(lineify("LIBRARIES", "${" + librariesCmakeName + "}"))
- cm_fh.write(" CODE\n")
+ if librariesCmakeName != "" or len(library_list) != 0:
+ cm_fh.write(" LIBRARIES\n")
+ if librariesCmakeName != "":
+ cm_fh.write(lineify("", "${" + librariesCmakeName + "}"))
+ if len(library_list) != 0:
+ cm_fh.write(" ")
+ cm_fh.write("\n ".join(library_list))
+ cm_fh.write("\n")
+ cm_fh.write(" CODE\n")
cm_fh.write('"' + sourceCode + '"')
if qmakeFixme != "":
cm_fh.write(qmakeFixme)