mirror of https://gitlab.com/cppit/jucipp
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
70 lines
2.2 KiB
70 lines
2.2 KiB
|
8 years ago
|
#pragma once
|
||
|
6 years ago
|
#include "cmake.hpp"
|
||
|
|
#include "meson.hpp"
|
||
|
8 years ago
|
#include <boost/filesystem.hpp>
|
||
|
10 years ago
|
|
||
|
|
namespace Project {
|
||
|
|
class Build {
|
||
|
|
public:
|
||
|
|
virtual ~Build() {}
|
||
|
8 years ago
|
|
||
|
10 years ago
|
boost::filesystem::path project_path;
|
||
|
8 years ago
|
|
||
|
8 years ago
|
virtual boost::filesystem::path get_default_path();
|
||
|
8 years ago
|
virtual bool update_default(bool force = false) { return false; }
|
||
|
8 years ago
|
virtual boost::filesystem::path get_debug_path();
|
||
|
8 years ago
|
virtual bool update_debug(bool force = false) { return false; }
|
||
|
|
|
||
|
8 years ago
|
virtual std::string get_compile_command() { return std::string(); }
|
||
|
8 years ago
|
virtual boost::filesystem::path get_executable(const boost::filesystem::path &path) { return boost::filesystem::path(); }
|
||
|
|
|
||
|
10 years ago
|
static std::unique_ptr<Build> create(const boost::filesystem::path &path);
|
||
|
10 years ago
|
};
|
||
|
8 years ago
|
|
||
|
10 years ago
|
class CMakeBuild : public Build {
|
||
|
10 years ago
|
::CMake cmake;
|
||
|
8 years ago
|
|
||
|
10 years ago
|
public:
|
||
|
10 years ago
|
CMakeBuild(const boost::filesystem::path &path);
|
||
|
8 years ago
|
|
||
|
|
bool update_default(bool force = false) override;
|
||
|
|
bool update_debug(bool force = false) override;
|
||
|
|
|
||
|
8 years ago
|
std::string get_compile_command() override;
|
||
|
10 years ago
|
boost::filesystem::path get_executable(const boost::filesystem::path &path) override;
|
||
|
|
};
|
||
|
8 years ago
|
|
||
|
9 years ago
|
class MesonBuild : public Build {
|
||
|
|
Meson meson;
|
||
|
8 years ago
|
|
||
|
9 years ago
|
public:
|
||
|
|
MesonBuild(const boost::filesystem::path &path);
|
||
|
8 years ago
|
|
||
|
|
bool update_default(bool force = false) override;
|
||
|
|
bool update_debug(bool force = false) override;
|
||
|
|
|
||
|
8 years ago
|
std::string get_compile_command() override;
|
||
|
9 years ago
|
boost::filesystem::path get_executable(const boost::filesystem::path &path) override;
|
||
|
|
};
|
||
|
8 years ago
|
|
||
|
7 years ago
|
class CompileCommandsBuild : public Build {
|
||
|
|
public:
|
||
|
|
CompileCommandsBuild(const boost::filesystem::path &path);
|
||
|
|
};
|
||
|
|
|
||
|
8 years ago
|
class CargoBuild : public Build {
|
||
|
|
public:
|
||
|
8 years ago
|
boost::filesystem::path get_default_path() override { return project_path / "target" / "debug"; }
|
||
|
|
bool update_default(bool force = false) override { return true; }
|
||
|
8 years ago
|
boost::filesystem::path get_debug_path() override { return get_default_path(); }
|
||
|
8 years ago
|
bool update_debug(bool force = false) override { return true; }
|
||
|
|
|
||
|
8 years ago
|
std::string get_compile_command() override { return "cargo build"; }
|
||
|
8 years ago
|
boost::filesystem::path get_executable(const boost::filesystem::path &path) override { return get_debug_path() / project_path.filename(); }
|
||
|
8 years ago
|
};
|
||
|
8 years ago
|
|
||
|
|
class NpmBuild : public Build {};
|
||
|
7 years ago
|
|
||
|
|
class PythonMain : public Build {};
|
||
|
8 years ago
|
} // namespace Project
|