Changeset View
Changeset View
Standalone View
Standalone View
plugins/custom-definesandincludes/compilerprovider/icompiler.h
Show All 23 Lines | |||||
24 | #ifndef ICOMPILER_H | 24 | #ifndef ICOMPILER_H | ||
25 | #define ICOMPILER_H | 25 | #define ICOMPILER_H | ||
26 | 26 | | |||
27 | #include <QString> | 27 | #include <QString> | ||
28 | #include <QSharedPointer> | 28 | #include <QSharedPointer> | ||
29 | 29 | | |||
30 | #include "../idefinesandincludesmanager.h" | 30 | #include "../idefinesandincludesmanager.h" | ||
31 | 31 | | |||
32 | namespace Utils | ||||
33 | { | ||||
34 | enum LanguageType | ||||
35 | { | ||||
36 | C, | ||||
37 | Cpp, | ||||
38 | OpenCl, | ||||
39 | Cuda, | ||||
40 | ObjC, | ||||
41 | | ||||
42 | Other = 100 | ||||
apol: Make `Other` the first, this way you don't have to add this random ` = 100` there if you want. | |||||
Not a bad idea, but I wanted to leave the enumeration the same for now. aaronpuchert: Not a bad idea, but I wanted to leave the enumeration the same for now. | |||||
43 | }; | ||||
44 | } | ||||
45 | | ||||
32 | /// An interface that represents a compiler. Compiler provides standard include directories and standard defined macros. | 46 | /// An interface that represents a compiler. Compiler provides standard include directories and standard defined macros. | ||
33 | class ICompiler | 47 | class ICompiler | ||
34 | { | 48 | { | ||
35 | public: | 49 | public: | ||
36 | /** | 50 | /** | ||
37 | * @param name The user visible name | 51 | * @param name The user visible name | ||
38 | * @param path path to the compiler | 52 | * @param path path to the compiler | ||
39 | * @param factoryName name of the factory that created this compiler | 53 | * @param factoryName name of the factory that created this compiler | ||
40 | * @param editable whether user can change the name and the path to the compiler (should be set to false for automatically detected compilers) | 54 | * @param editable whether user can change the name and the path to the compiler (should be set to false for automatically detected compilers) | ||
41 | **/ | 55 | **/ | ||
42 | ICompiler( const QString& name, const QString& path, const QString& factoryName, bool editable ); | 56 | ICompiler( const QString& name, const QString& path, const QString& factoryName, bool editable ); | ||
43 | 57 | | |||
44 | /** | 58 | /** | ||
45 | * @param arguments compiler command-line arguments | 59 | * @param arguments compiler command-line arguments | ||
46 | * @return list of defined macros for the compiler | 60 | * @return list of defined macros for the compiler | ||
47 | */ | 61 | */ | ||
48 | virtual KDevelop::Defines defines(const QString& arguments) const = 0; | 62 | virtual KDevelop::Defines defines(Utils::LanguageType type, const QString& arguments) const = 0; | ||
49 | 63 | | |||
50 | /** | 64 | /** | ||
51 | * @param arguments compiler command-line arguments | 65 | * @param arguments compiler command-line arguments | ||
52 | * @return list of include directories for the compiler | 66 | * @return list of include directories for the compiler | ||
53 | */ | 67 | */ | ||
54 | virtual KDevelop::Path::List includes(const QString& arguments) const = 0; | 68 | virtual KDevelop::Path::List includes(Utils::LanguageType type, const QString& arguments) const = 0; | ||
55 | 69 | | |||
56 | void setPath( const QString &path ); | 70 | void setPath( const QString &path ); | ||
57 | 71 | | |||
58 | /// @return path to the compiler | 72 | /// @return path to the compiler | ||
59 | QString path() const; | 73 | QString path() const; | ||
60 | 74 | | |||
61 | void setName( const QString &name ); | 75 | void setName( const QString &name ); | ||
62 | 76 | | |||
Show All 23 Lines |
Make Other the first, this way you don't have to add this random = 100 there if you want.