/**************************************************************************** ** ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the qmake application of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL21$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see http://www.qt.io/terms-conditions. For further ** information use the contact form at http://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 or version 3 as published by the Free ** Software Foundation and appearing in the file LICENSE.LGPLv21 and ** LICENSE.LGPLv3 included in the packaging of this file. Please review the ** following information to ensure the GNU Lesser General Public License ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** As a special exception, The Qt Company gives you certain additional ** rights. These rights are described in The Qt Company LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #include "meta.h" #include "project.h" #include "option.h" #include QT_BEGIN_NAMESPACE QHash QMakeMetaInfo::cache_vars; QMakeMetaInfo::QMakeMetaInfo(QMakeProject *_conf) : conf(_conf) { } bool QMakeMetaInfo::readLib(QString lib) { clear(); QString meta_file = findLib(lib); if(cache_vars.contains(meta_file)) { vars = cache_vars[meta_file]; return true; } bool ret = false; if(!meta_file.isNull()) { if(meta_file.endsWith(Option::pkgcfg_ext)) { if((ret=readPkgCfgFile(meta_file))) meta_type = "pkgcfg"; } else if(meta_file.endsWith(Option::libtool_ext)) { if((ret=readLibtoolFile(meta_file))) meta_type = "libtool"; } else if(meta_file.endsWith(Option::prl_ext)) { QMakeProject proj; if (!proj.read(Option::normalizePath(meta_file), QMakeEvaluator::LoadProOnly)) return false; meta_type = "qmake"; vars = proj.variables(); ret = true; } else { warn_msg(WarnLogic, "QMakeMetaInfo: unknown file format for %s", QDir::toNativeSeparators(meta_file).toLatin1().constData()); } } if(ret) cache_vars.insert(meta_file, vars); return ret; } void QMakeMetaInfo::clear() { vars.clear(); } QString QMakeMetaInfo::findLib(QString lib) { lib = Option::normalizePath(lib); QString ret; QString extns[] = { Option::prl_ext, /*Option::pkgcfg_ext, Option::libtool_ext,*/ QString() }; for(int extn = 0; !extns[extn].isNull(); extn++) { if(lib.endsWith(extns[extn])) ret = QFile::exists(lib) ? lib : QString(); } if(ret.isNull()) { for(int extn = 0; !extns[extn].isNull(); extn++) { if(QFile::exists(lib + extns[extn])) { ret = lib + extns[extn]; break; } } } if(ret.isNull()) { debug_msg(2, "QMakeMetaInfo: Cannot find info file for %s", lib.toLatin1().constData()); } else { debug_msg(2, "QMakeMetaInfo: Found info file %s for %s", ret.toLatin1().constData(), lib.toLatin1().constData()); } return ret; } bool QMakeMetaInfo::readLibtoolFile(const QString &f) { /* I can just run the .la through the .pro parser since they are compatible.. */ QMakeProject proj; QString nf = Option::normalizePath(f); if (!proj.read(nf, QMakeEvaluator::LoadProOnly)) return false; QString dirf = nf.section(QLatin1Char('/'), 0, -2); if(dirf == nf) dirf = ""; else if(!dirf.isEmpty() && !dirf.endsWith(Option::output_dir)) dirf += QLatin1Char('/'); const ProValueMap &v = proj.variables(); for (ProValueMap::ConstIterator it = v.begin(); it != v.end(); ++it) { ProStringList lst = it.value(); if(lst.count() == 1 && (lst.first().startsWith("'") || lst.first().startsWith("\"")) && lst.first().endsWith(QString(lst.first().at(0)))) lst = ProStringList(lst.first().mid(1, lst.first().length() - 2)); if(!vars.contains("QMAKE_PRL_TARGET") && (it.key() == "dlname" || it.key() == "library_names" || it.key() == "old_library")) { ProString dir = v["libdir"].first(); if ((dir.startsWith('\'') || dir.startsWith('"')) && dir.endsWith(dir.at(0))) dir = dir.mid(1, dir.length() - 2); dir = dir.trimmed(); if(!dir.isEmpty() && !dir.endsWith(QLatin1Char('/'))) dir += QLatin1Char('/'); if(lst.count() == 1) lst = ProStringList(lst.first().toQString().split(" ")); for (ProStringList::Iterator lst_it = lst.begin(); lst_it != lst.end(); ++lst_it) { bool found = false; QString dirs[] = { "", dir.toQString(), dirf, dirf + ".libs/", "(term)" }; for(int i = 0; !found && dirs[i] != "(term)"; i++) { if(QFile::exists(dirs[i] + (*lst_it))) { QString targ = dirs[i] + (*lst_it); if(QDir::isRelativePath(targ)) targ.prepend(qmake_getpwd() + QLatin1Char('/')); vars["QMAKE_PRL_TARGET"] << targ; found = true; } } if(found) break; } } else if(it.key() == "dependency_libs") { if(lst.count() == 1) { ProString dep = lst.first(); if ((dep.startsWith('\'') || dep.startsWith('"')) && dep.endsWith(dep.at(0))) dep = dep.mid(1, dep.length() - 2); lst = ProStringList(dep.trimmed().toQString().split(" ")); } for (ProStringList::Iterator lit = lst.begin(); lit != lst.end(); ++lit) { if((*lit).startsWith("-R")) { if(!conf->isEmpty("QMAKE_LFLAGS_RPATH")) (*lit) = conf->first("QMAKE_LFLAGS_RPATH") + (*lit).mid(2); } } ProStringList &prlLibs = vars["QMAKE_PRL_LIBS"]; foreach (const ProString &s, lst) { prlLibs.removeAll(s); prlLibs.append(s); } } } return true; } bool QMakeMetaInfo::readPkgCfgFile(const QString &f) { fprintf(stderr, "Must implement reading in pkg-config files (%s)!!!\n", f.toLatin1().constData()); return false; } QT_END_NAMESPACE ream/revert-78134-fix78059'>upstream/revert-78134-fix78059 Vendor branches of https://github.com/llvm/llvm-project.git
summaryrefslogtreecommitdiffstats
Commit message (Expand)AuthorAgeFilesLines
* Reland "[CMake] Bumps minimum version to 3.20.0.Mark de Wever2023-05-271-9/+6
* Revert "Reland "[CMake] Bumps minimum version to 3.20.0.""Nico Weber2023-05-171-1/+8
* Reland "[CMake] Bumps minimum version to 3.20.0."Mark de Wever2023-05-131-8/+1
* Revert "Reland "[CMake] Bumps minimum version to 3.20.0.""Mark de Wever2023-05-061-1/+8
* Reland "[CMake] Bumps minimum version to 3.20.0."Mark de Wever2023-05-061-8/+1
* Revert "Revert "Revert "[CMake] Bumps minimum version to 3.20.0."""Mark de Wever2023-04-151-1/+8
* Revert "Revert "[CMake] Bumps minimum version to 3.20.0.""Mark de Wever2023-04-151-8/+1
* Revert "[CMake] Unify llvm_check_linker_flag and llvm_check_compiler_linker_f...Petr Hosek2023-03-281-4/+1
* [runtimes][CMake] Drop the check to see if linker worksPetr Hosek2023-03-281-30/+32
* [CMake] Unify llvm_check_linker_flag and llvm_check_compiler_linker_flagPetr Hosek2023-03-281-1/+4
* [runtimes] Don't use -Wall on clang-cl buildsNikolas Klauser2023-03-191-1/+0
* Revert "Reland "[CMake] Bumps minimum version to 3.20.0.""Mark de Wever2023-03-181-1/+8
* Reland "[CMake] Bumps minimum version to 3.20.0."Mark de Wever2023-03-181-8/+1
* [runtimes] Synchronize warnings flags between libc++/libc++abi/libunwindNikolas Klauser2023-03-171-0/+78
* Revert "[CMake] Bumps minimum version to 3.20.0."Mark de Wever2023-03-041-1/+8
* [CMake] Bumps minimum version to 3.20.0.Mark de Wever2023-03-041-8/+1
* Revert "[CMake] Unify llvm_check_linker_flag and llvm_check_compiler_linker_f...Petr Hosek2023-02-221-3/+3
* [CMake] Unify llvm_check_linker_flag and llvm_check_compiler_linker_flagPetr Hosek2023-02-221-3/+3
* [runtimes] Move common functions from Handle{Libcxx,Libcxxabi,Libunwind}Flags...Nikolas Klauser2023-02-211-0/+113
* [CMake] Setting the LLVM_TARGET_TRIPLE macro based on the LLVM_DEFAULT_TARGET...Nicole Rabjohn2022-12-131-0/+3
* [CMake] Warn when the version is older than 3.20.0.Mark de Wever2022-12-111-0/+7
* Revert "[CMake] Use LLVM_TARGET_TRIPLE in runtimes"Leonard Chan2022-12-051-2/+2
* [runtimes] Fix runtimes-test-dependsShoaib Meenai2022-11-301-1/+6
* [runtimes] Name stripped install targets consistentlyShoaib Meenai2022-11-301-3/+0
* [CMake] Use LLVM_TARGET_TRIPLE in runtimesPetr Hosek2022-11-291-2/+2
* [CMake][compiler-rt] Don't load LLVM config in the runtimes buildPetr Hosek2022-11-151-0/+1
* [runtimes] Use a response file for runtimes test suitesPetr Hosek2022-10-122-12/+6
* Revert "[runtimes] Use a response file for runtimes test suites"Arthur Eubanks2022-08-292-4/+9
* [runtimes][NFC] Colocate handling of LLVM_ENABLE_PROJECTS and LLVM_ENABLE_RUN...Louis Dionne2022-08-241-3/+3
* [runtimes] Use a response file for runtimes test suitesPetr Hosek2022-08-242-9/+4
* [compiler-rt][libunwind][runtimes] Recategorize `llvm_check_linker_flag` langsJohn Ericson2022-08-171-1/+1
* [runtimes] Add pstl to the list of default runtimes to fix the buildNikolas Klauser2022-07-221-1/+1
* [runtimes] adds llvm-libgcc to the list of runtimes to be sortedChristopher Di Bella2022-06-301-2/+3
* Restore missing runtimes-test-depends target that causes build failures when ...James Nagurne2022-06-131-0/+4
* [CMake][libcxx] Use target_include_directories for libc++ headersPetr Hosek2022-06-121-0/+20
* [runtimes] Generalize how we reorder projectsLouis Dionne2022-05-161-35/+16
* [runtimes] [CMake] Fix checks for -Werror when building with incomplete toolc...Martin Storsjö2022-05-131-0/+20
* Revert "[CMake][libcxx] Use target_include_directories for libc++ headers"Petr Hosek2022-05-061-11/+0
* [CMake][libcxx] Use target_include_directories for libc++ headersPetr Hosek2022-05-061-0/+11
* [runtimes] Always configure libc++abi before libc++Louis Dionne2022-05-061-22/+22
* Generalize "check-all" umbrella targets, use for check-clang-toolsSam McCall2022-05-062-27/+6
* [runtimes] [CMake] Rename a cmake variable missed in b3df14b6c98702ce50401fd0...Martin Storsjö2022-04-251-2/+2
* [runtimes] [CMake] Unify variable namesPetr Hosek2022-04-24