Merge remote-tracking branch 'origin/13.0' into 14.0

Conflicts:
	src/plugins/copilot/copilotsettings.cpp

Change-Id: I6d17cf8968d6efbafb883da8346c7950349f7d84
This commit is contained in:
Eike Ziller
2024-06-04 14:43:35 +02:00
7 changed files with 138 additions and 42 deletions

View File

@@ -209,12 +209,9 @@ static bool isChildOf(const FilePath &path, const FilePaths &prefixes)
static CMakeBuildTarget toBuildTarget(const TargetDetails &t,
const FilePath &sourceDirectory,
const FilePath &buildDirectory,
bool relativeLibs,
const QSet<FilePath> &sharedLibraryArtifacts)
bool relativeLibs)
{
const FilePath currentBuildDir = buildDirectory.resolvePath(t.buildDir);
const QSet<FilePath> sharedLibraryArtifactsPaths
= transform(sharedLibraryArtifacts, &FilePath::parentDir);
CMakeBuildTarget ct;
ct.title = t.name;
@@ -323,18 +320,18 @@ static CMakeBuildTarget toBuildTarget(const TargetDetails &t,
// "/usr/local/lib" since these are usually in the standard search
// paths. There probably are more, but the naming schemes are arbitrary
// so we'd need to ask the linker ("ld --verbose | grep SEARCH_DIR").
if (buildDir.osType() != OsTypeWindows
&& !isChildOf(tmp,
{"/lib", "/lib64", "/usr/lib", "/usr/lib64", "/usr/local/lib"}))
if (buildDir.osType() == OsTypeWindows
|| !isChildOf(tmp,
{"/lib",
"/lib64",
"/usr/lib",
"/usr/lib64",
"/usr/local/lib"})) {
librarySeachPaths.append(tmp);
if (buildDir.osType() == OsTypeWindows) {
if (sharedLibraryArtifactsPaths.contains(tmp))
librarySeachPaths.append(tmp);
// Libraries often have their import libs in ../lib and the
// actual dll files in ../bin on windows. Qt is one example of that.
if (tmp.fileName() == "lib") {
if (tmp.fileName() == "lib" && buildDir.osType() == OsTypeWindows) {
const FilePath path = tmp.parentDir().pathAppended("bin");
if (path.isDir())
librarySeachPaths.append(path);
@@ -355,19 +352,12 @@ static QList<CMakeBuildTarget> generateBuildTargets(const QFuture<void> &cancelF
const FilePath &buildDirectory,
bool relativeLibs)
{
QSet<FilePath> sharedLibraryArtifacts;
for (const TargetDetails &t : input.targetDetails)
if (t.type == "MODULE_LIBRARY" || t.type == "SHARED_LIBRARY")
for (const FilePath &p : t.artifacts)
sharedLibraryArtifacts.insert(buildDirectory.resolvePath(p));
QList<CMakeBuildTarget> result;
result.reserve(input.targetDetails.size());
for (const TargetDetails &t : input.targetDetails) {
if (cancelFuture.isCanceled())
return {};
result.append(
toBuildTarget(t, sourceDirectory, buildDirectory, relativeLibs, sharedLibraryArtifacts));
result.append(toBuildTarget(t, sourceDirectory, buildDirectory, relativeLibs));
}
return result;
}