[1275] | 1 | // This may look like C code, but it is really -*- C++ -*-
|
---|
| 2 | // Gestionnaire de compilation-linker C++ - R. Ansari 10/2000
|
---|
| 3 | // LAL (Orsay) / IN2P3-CNRS DAPNIA/SPP (Saclay) / CEA
|
---|
| 4 |
|
---|
| 5 | #ifndef CXXCOMPILERLINKER_SEEN
|
---|
| 6 | #define CXXCOMPILERLINKER_SEEN
|
---|
| 7 |
|
---|
| 8 | #include "machdefs.h"
|
---|
| 9 | #include <string>
|
---|
| 10 |
|
---|
| 11 |
|
---|
| 12 | namespace SOPHYA {
|
---|
| 13 |
|
---|
| 14 | //! C++ compiler - linker
|
---|
| 15 |
|
---|
| 16 | class CxxCompilerLinker {
|
---|
| 17 | public:
|
---|
[1900] | 18 | CxxCompilerLinker(bool fglibsophya=true, bool fglibextsophya=true,
|
---|
| 19 | bool fglibpi=false);
|
---|
[1275] | 20 | virtual ~CxxCompilerLinker();
|
---|
| 21 |
|
---|
[1277] | 22 | virtual int Compile(string const & name, string & oname);
|
---|
| 23 | virtual int BuildSO(string const & oname, string & soname);
|
---|
[1275] | 24 |
|
---|
[2212] | 25 | //! Adds compilation options \c opt . Appended to the present option string.
|
---|
[1275] | 26 | inline void AddCompileOptions(string const & opt)
|
---|
[1288] | 27 | { compOptions += " " + opt; }
|
---|
[2212] | 28 | //! Sets the compilation options.
|
---|
[1275] | 29 | inline void SetCompileOptions(string const & opt = "")
|
---|
| 30 | { compOptions = opt; }
|
---|
[2212] | 31 | //! Returns the currently defined compilation options.
|
---|
[1275] | 32 | inline string GetCompileOptions()
|
---|
| 33 | { return compOptions; }
|
---|
| 34 |
|
---|
[2212] | 35 | //! Adds link options \c opt . Appended to the present option string.
|
---|
[1275] | 36 | inline void AddLinkOptions(string const & opt)
|
---|
[1288] | 37 | { linkOptions += " " + opt; }
|
---|
[2212] | 38 | //! Sets the link options.
|
---|
[1275] | 39 | inline void SetLinkOptions(string const & opt = "")
|
---|
| 40 | { linkOptions = opt; }
|
---|
| 41 | inline string GetLinkOptions()
|
---|
[2212] | 42 | //! Returns the currently defined link options.
|
---|
[1275] | 43 | { return linkOptions; }
|
---|
| 44 |
|
---|
[2212] | 45 | //! Sets the temporary directory path.
|
---|
[1275] | 46 | inline void SetTmpDir(string const & tmpdir)
|
---|
| 47 | { tmpDir = tmpdir; }
|
---|
[2212] | 48 | //! returns the currently defined temporary directory path.
|
---|
[1275] | 49 | inline string GetTmpDir()
|
---|
| 50 | { return tmpDir; }
|
---|
[2212] | 51 |
|
---|
| 52 | //! Activate (or deactivate) the verbose mode.
|
---|
[1275] | 53 | inline void SetVerbose(bool fg=false)
|
---|
| 54 | { verbose = fg; }
|
---|
| 55 |
|
---|
| 56 | protected :
|
---|
| 57 | string tmpDir;
|
---|
| 58 | string compCmd;
|
---|
[1900] | 59 | string linkCmd;
|
---|
[1275] | 60 | string compOptions;
|
---|
| 61 | string linkOptions;
|
---|
| 62 | string cppFlags;
|
---|
| 63 | bool verbose;
|
---|
| 64 | };
|
---|
| 65 |
|
---|
| 66 | } // namespace SOPHYA
|
---|
| 67 |
|
---|
| 68 | #endif
|
---|