diff options
author | Roland Reichwein <mail@reichwein.it> | 2024-05-04 14:43:48 +0200 |
---|---|---|
committer | Roland Reichwein <mail@reichwein.it> | 2024-05-04 14:43:48 +0200 |
commit | 44479895f325cbbc283553dcb10b29a0af3b480b (patch) | |
tree | f29b9da1c782554ec3cef375d7cc771a0d56756e /file.cpp | |
parent | 45983abe664be648b513202c8c12578c9a85784f (diff) |
Added yscan
Diffstat (limited to 'file.cpp')
-rw-r--r-- | file.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/file.cpp b/file.cpp new file mode 100644 index 0000000..823d723 --- /dev/null +++ b/file.cpp @@ -0,0 +1,24 @@ +#include "file.h" + +#include <unordered_set> + +namespace fs = std::filesystem; + +const fs::path YMakefile{"YMakefile"}; + +// type of file can be built from dependencies +bool is_buildable_by_extension(const fs::path& p) { + fs::path ext{p.extension()}; + return ext.empty() || ext == ".o"; +} + +namespace { + std::unordered_set<fs::path> compile_unit_source_types{".cpp", ".c"}; +} + +// type of file is source of compile unit (no included types like headers) +bool is_compile_unit_source_by_extension(const fs::path& p) { + fs::path ext{p.extension()}; + return compile_unit_source_types.find(ext) != compile_unit_source_types.end(); +} + |