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.
61 lines
2.1 KiB
61 lines
2.1 KiB
|
8 years ago
|
#pragma once
|
||
|
10 years ago
|
#include <boost/filesystem.hpp>
|
||
|
|
#include "cmake.h"
|
||
|
9 years ago
|
#include "meson.h"
|
||
|
10 years ago
|
|
||
|
|
namespace Project {
|
||
|
|
class Build {
|
||
|
|
public:
|
||
|
|
virtual ~Build() {}
|
||
|
|
|
||
|
|
boost::filesystem::path project_path;
|
||
|
|
|
||
|
8 years ago
|
virtual boost::filesystem::path get_default_path();
|
||
|
10 years ago
|
virtual bool update_default(bool force=false) {return false;}
|
||
|
8 years ago
|
virtual boost::filesystem::path get_debug_path();
|
||
|
10 years ago
|
virtual bool update_debug(bool force=false) {return false;}
|
||
|
10 years ago
|
|
||
|
8 years ago
|
virtual std::string get_compile_command() { return std::string(); }
|
||
|
10 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
|
};
|
||
|
|
|
||
|
10 years ago
|
class CMakeBuild : public Build {
|
||
|
10 years ago
|
::CMake cmake;
|
||
|
|
public:
|
||
|
10 years ago
|
CMakeBuild(const boost::filesystem::path &path);
|
||
|
10 years ago
|
|
||
|
10 years ago
|
bool update_default(bool force=false) override;
|
||
|
|
bool update_debug(bool force=false) override;
|
||
|
10 years ago
|
|
||
|
8 years ago
|
std::string get_compile_command() override;
|
||
|
10 years ago
|
boost::filesystem::path get_executable(const boost::filesystem::path &path) override;
|
||
|
|
};
|
||
|
9 years ago
|
|
||
|
|
class MesonBuild : public Build {
|
||
|
|
Meson meson;
|
||
|
|
public:
|
||
|
|
MesonBuild(const boost::filesystem::path &path);
|
||
|
|
|
||
|
|
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
|
|
||
|
8 years ago
|
class CargoBuild : public Build {
|
||
|
|
public:
|
||
|
|
boost::filesystem::path get_default_path() override { return project_path/"target"/"debug"; }
|
||
|
|
bool update_default(bool force=false) override { return true; }
|
||
|
|
boost::filesystem::path get_debug_path() override { return get_default_path(); }
|
||
|
|
bool update_debug(bool force=false) override { return true; }
|
||
|
|
|
||
|
|
std::string get_compile_command() override { return "cargo build"; }
|
||
|
|
boost::filesystem::path get_executable(const boost::filesystem::path &path) override { return get_debug_path()/project_path.filename(); }
|
||
|
|
};
|
||
|
8 years ago
|
|
||
|
|
class NpmBuild : public Build {};
|
||
|
10 years ago
|
}
|