Changeset View
Changeset View
Standalone View
Standalone View
plugins/meson/mesonconfig.h
- This file was added.
1 | /* This file is part of KDevelop | ||||
---|---|---|---|---|---|
2 | Copyright 2017 Aleix Pol Gonzalez <aleixpol@kde.org> | ||||
3 | Copyright 2018 Daniel Mensinger <daniel@mensinger-ka.de> | ||||
4 | | ||||
5 | This library is free software; you can redistribute it and/or | ||||
6 | modify it under the terms of the GNU Library General Public | ||||
7 | License as published by the Free Software Foundation; either | ||||
8 | version 2 of the License, or (at your option) any later version. | ||||
9 | | ||||
10 | This library is distributed in the hope that it will be useful, | ||||
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||||
13 | Library General Public License for more details. | ||||
14 | | ||||
15 | You should have received a copy of the GNU Library General Public License | ||||
16 | along with this library; see the file COPYING.LIB. If not, write to | ||||
17 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||||
18 | Boston, MA 02110-1301, USA. | ||||
19 | */ | ||||
20 | | ||||
21 | #pragma once | ||||
22 | | ||||
23 | #include <KConfigGroup> | ||||
24 | #include <util/path.h> | ||||
25 | | ||||
26 | namespace KDevelop | ||||
27 | { | ||||
28 | class IProject; | ||||
29 | } | ||||
30 | | ||||
31 | namespace Meson | ||||
32 | { | ||||
33 | | ||||
34 | struct BuildDir { | ||||
35 | KDevelop::Path buildDir; | ||||
36 | KDevelop::Path installPrefix; | ||||
37 | KDevelop::Path mesonExecutable; | ||||
38 | QString buildType; | ||||
39 | QString mesonBackend; | ||||
40 | QString mesonArgs; | ||||
41 | | ||||
42 | bool isValid() const; | ||||
43 | void canonicalizePaths(); | ||||
44 | }; | ||||
45 | | ||||
46 | struct MesonConfig | ||||
47 | { | ||||
48 | int currentIndex = -1; | ||||
49 | QVector<BuildDir> buildDirs; | ||||
50 | | ||||
51 | int addBuildDir(BuildDir dir); | ||||
52 | bool removeBuildDir(int index); | ||||
53 | }; | ||||
54 | | ||||
55 | KConfigGroup rootGroup(KDevelop::IProject* project); | ||||
56 | BuildDir currentBuildDir(KDevelop::IProject* project); | ||||
57 | MesonConfig getMesonConfig(KDevelop::IProject* project); | ||||
58 | void writeMesonConfig(KDevelop::IProject* project, MesonConfig const& cfg); | ||||
59 | | ||||
60 | } |