blob: d403d9e9ba58dfc3460c9d712476d9f818d50b64 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
#ifndef ICECOMPILE_H
#define ICECOMPILE_H
#include "options.h"
#include <string>
#include <boost/filesystem/path.hpp>
#include <boost/optional.hpp>
class IceCompile {
public:
INITOPTIONS;
typedef std::vector<const IceCompile *> Deps;
static std::string slice2cpp;
static std::string cxx;
static std::string linker;
static std::string cxxopts;
static std::string linkeropts;
static boost::filesystem::path tmpdir;
static boost::filesystem::path headerdir;
IceCompile(const boost::filesystem::path & slice);
IceCompile(const boost::filesystem::path & slice, const Deps & deps);
/// Conditionally execute Build, Compile, Link as required
void Update() const;
/// Source file path (e.g. /some/path/slice.ice)
virtual boost::filesystem::path InputPath() const = 0;
/// File name (no extension) in temporary directory (e.g. clientSlice)
virtual boost::filesystem::path OutputName(const std::string & type) const = 0;
typedef boost::shared_ptr<void> LibHandle;
LibHandle Open() const;
protected:
virtual void Build(const boost::filesystem::path & in, const boost::filesystem::path & out) const = 0;
void Compile(const boost::filesystem::path & in, const boost::filesystem::path & out) const;
void Link(const boost::filesystem::path & in, const boost::filesystem::path & out) const;
typedef void (IceCompile::*UpdateFunc)(const boost::filesystem::path & in, const boost::filesystem::path & out) const;
void update(const boost::filesystem::path & in, const boost::filesystem::path & out, UpdateFunc func) const;
const boost::filesystem::path slice;
private:
const Deps deps;
};
#endif
|