| 1 |
#ifndef MSYS2_HPP |
| 2 |
#define MSYS2_HPP |
| 3 |
|
| 4 |
#include "PlatformCommon.hpp" |
| 5 |
#include "codelite_exports.h" |
| 6 |
|
| 7 |
class WXDLLIMPEXP_CL MSYS2 : public PlatformCommon |
| 8 |
{ |
| 9 |
bool m_checked_for_install_dir = false; |
| 10 |
wxString m_install_dir; |
| 11 |
bool m_checked_for_home_dir = false; |
| 12 |
wxString m_home_dir; |
| 13 |
wxArrayString m_chroots; |
| 14 |
|
| 15 |
public: |
| 16 |
MSYS2(); |
| 17 |
virtual ~MSYS2() {} |
| 18 |
|
| 19 |
static MSYS2* Get(); |
| 20 |
|
| 21 |
public: |
| 22 |
/** |
| 23 |
* @brief locate msys2 installation folder (e.g. C:/msys2) |
| 24 |
*/ |
| 25 |
bool FindInstallDir(wxString* msyspath) override; |
| 26 |
/** |
| 27 |
* @brief locate the home folder within msys2 (e.g. C:/msys2/home/eran) |
| 28 |
*/ |
| 29 |
bool FindHomeDir(wxString* homedir) override; |
| 30 |
|
| 31 |
/** |
| 32 |
* @brief check if a command "command" is installed and return its fullpath |
| 33 |
*/ |
| 34 |
bool Which(const wxString& command, wxString* command_fullpath) override; |
| 35 |
|
| 36 |
/** |
| 37 |
* @brief set the chroot folder |
| 38 |
*/ |
| 39 |
void SetChroot(const wxString& chroot = "\\clang64") override; |
| 40 |
|
| 41 |
/** |
| 42 |
* @brief some vendros deliver binaries with "-N" where N is the version number |
| 43 |
* this method attempts to search for command-<N>...command (in this order) |
| 44 |
*/ |
| 45 |
bool WhichWithVersion(const wxString& command, const std::vector<int>& versions, wxString* command_fullpath); |
| 46 |
}; |
| 47 |
|
| 48 |
#endif // MSYS2_HPP |