1
0
mirror of synced 2025-02-02 20:37:25 +01:00

Add docs and an extra check when searching the songs folder

This commit is contained in:
Stepland 2020-01-26 00:27:58 +01:00
parent cf873f7ad2
commit 59960de2bb
3 changed files with 35 additions and 9 deletions

24
docs/Compiling.md Normal file
View File

@ -0,0 +1,24 @@
# Compiling jujube
jujube uses the meson build system.
Only time will tell if this turned out to be a wise choice, I just can't stand CMake.
jujube needs a *very* up to date C++ compiler for I'm using stuff like `std::filesystem` which is, at the time of writing, easily availble only on the very last version of your favorite compiler
## Linux
### Dependencies
- **SFML 2.5.1** : You will most likely need to build SFML yourself, and with the same compiler as the one you will use for jujube because if you just get precompiled binaries for SFML from your package manager you *will* have compatibility problems. [Here's](https://www.sfml-dev.org/tutorials/2.5/compile-with-cmake.php) their docs.
- **meson** : Installation explained [here](https://mesonbuild.com/Quick-guide.html)
### Building
let's say you downloaded the source code in `jujube` and you decided to compile with `gcc-9`
```bash
$ cd jujube
$ CXX=gcc-9 meson build
$ cd build
$ ninja
```

View File

@ -10,8 +10,7 @@ foreach module : ['system', 'window', 'graphics', 'audio']
sfml += [dependency('sfml-'+module, version : '>=2.5.1')]
endforeach
cpp = meson.get_compiler('cpp')
filesystem = cpp.find_library('stdc++fs')
add_project_link_arguments(['-lstdc++', '-lstdc++fs'], language : 'cpp')
sources = [
'src/Main.cpp',
@ -40,7 +39,7 @@ sources = [
executable(
'jujube',
sources,
dependencies: [sfml, filesystem],
dependencies: [sfml],
include_directories : include_directories('include'),
cpp_args : [
'-Wall',

View File

@ -28,17 +28,20 @@ namespace Data {
const std::vector<fs::path> getSongFolders() {
std::vector<fs::path> song_folders;
std::vector<fs::path> potential_song_folders;
fs::path song_folder = "songs/";
if (fs::exists(song_folder) and fs::is_directory(song_folder)) {
for (const auto& dir_item : fs::directory_iterator("songs/")) {
if (dir_item.is_directory()) {
for (auto& path : recursiveSongSearch(dir_item.path())) {
song_folders.push_back(path);
potential_song_folders.push_back(path);
}
}
}
}
return song_folders;
return potential_song_folders;
}
std::list<fs::path> recursiveSongSearch(fs::path song_or_pack) {