| 1 |
#ifdef TRIBITSEXAPP2_HAVE_PACKAGE1 |
| 2 |
# include "Package1.hpp" |
| 3 |
#endif |
| 4 |
#ifdef TRIBITSEXAPP2_HAVE_PACKAGE2 |
| 5 |
# include "Package2.hpp" |
| 6 |
#endif |
| 7 |
#ifdef TRIBITSEXAPP2_HAVE_PACKAGE3 |
| 8 |
# include "Package3.hpp" |
| 9 |
#endif |
| 10 |
|
| 11 |
|
| 12 |
#include <iostream> |
| 13 |
#include <string> |
| 14 |
|
| 15 |
|
| 16 |
namespace Impl { |
| 17 |
void appendDepsStr(std::string &depsStr, const std::string &str); |
| 18 |
} |
| 19 |
|
| 20 |
|
| 21 |
int main(int argc, char *argv[]) { |
| 22 |
using Impl::appendDepsStr; |
| 23 |
// Get deps down the deps graph |
| 24 |
std::string depsStr; |
| 25 |
#ifdef TRIBITSEXAPP2_HAVE_PACKAGE3 |
| 26 |
appendDepsStr(depsStr, "Package3{"+Package3::deps()+"}"); |
| 27 |
#elif TRIBITSEXAPP2_HAVE_PACKAGE2 |
| 28 |
appendDepsStr(depsStr, "Package2{"+Package2::deps()+"}"); |
| 29 |
#elif TRIBITSEXAPP2_HAVE_PACKAGE1 |
| 30 |
appendDepsStr(depsStr, "Package1{"+Package1::deps()+"}"); |
| 31 |
#else |
| 32 |
depsStr = "no deps"; |
| 33 |
#endif |
| 34 |
// NOTE: The above all call functions from the libraries and requires that |
| 35 |
// both the header files be found at compile time and the libraries be found |
| 36 |
// at link time and runtime for this these function calls to work. |
| 37 |
|
| 38 |
std::cout << "Full Deps: " << depsStr << "\n"; |
| 39 |
|
| 40 |
return 0; |
| 41 |
} |
| 42 |
|
| 43 |
|
| 44 |
void Impl::appendDepsStr(std::string &depsStr, const std::string &str) |
| 45 |
{ |
| 46 |
if (depsStr.length()) { |
| 47 |
depsStr += ", "+str; |
| 48 |
} |
| 49 |
else { |
| 50 |
depsStr = str; |
| 51 |
} |
| 52 |
} |