Commit d7bd38faa4d9f8a4a0128f9ff4a8708004c516f7

Authored by Jordi Inglada
1 parent b87e773e
Exists in master

conditional definition for filesystem dependency

otherwise, on has always to link with compiled boost libs
Showing 1 changed file with 7 additions and 1 deletions   Show diff stats
include/cbutils.h
... ... @@ -27,8 +27,11 @@
27 27 #include <chrono>
28 28 #include <iomanip>
29 29 #include <regex>
  30 +
  31 +#ifdef USE_FILESYSEM
30 32 #include <boost/filesystem.hpp>
31 33 namespace fs = boost::filesystem;
  34 +#endif
32 35  
33 36 namespace cbutils
34 37 {
... ... @@ -117,8 +120,10 @@ std::size_t count_columns(const std::string&amp; fname,
117 120 }
118 121 return 0;
119 122 }
  123 +
  124 +#ifdef USE_FILESYSEM
120 125 // List the files in a directory eventually matching a pattern
121   -// needs to link with -lstdc++fs
  126 +// needs to link with -lboost_system -lboost_filesystem
122 127 std::vector<std::string> list_files(const std::string& dir,
123 128 const std::string& pattern = ".*")
124 129 {
... ... @@ -138,6 +143,7 @@ std::vector&lt;std::string&gt; list_files(const std::string&amp; dir,
138 143  
139 144 return result;
140 145 }
  146 +#endif
141 147 }//end ns file
142 148 // ----------------- Sequence manipulation -------------------------------------
143 149 namespace seq
... ...