Add docs and an extra check when searching the songs folder
This commit is contained in:
parent
cf873f7ad2
commit
59960de2bb
24
docs/Compiling.md
Normal file
24
docs/Compiling.md
Normal 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
|
||||||
|
```
|
@ -10,8 +10,7 @@ foreach module : ['system', 'window', 'graphics', 'audio']
|
|||||||
sfml += [dependency('sfml-'+module, version : '>=2.5.1')]
|
sfml += [dependency('sfml-'+module, version : '>=2.5.1')]
|
||||||
endforeach
|
endforeach
|
||||||
|
|
||||||
cpp = meson.get_compiler('cpp')
|
add_project_link_arguments(['-lstdc++', '-lstdc++fs'], language : 'cpp')
|
||||||
filesystem = cpp.find_library('stdc++fs')
|
|
||||||
|
|
||||||
sources = [
|
sources = [
|
||||||
'src/Main.cpp',
|
'src/Main.cpp',
|
||||||
@ -40,7 +39,7 @@ sources = [
|
|||||||
executable(
|
executable(
|
||||||
'jujube',
|
'jujube',
|
||||||
sources,
|
sources,
|
||||||
dependencies: [sfml, filesystem],
|
dependencies: [sfml],
|
||||||
include_directories : include_directories('include'),
|
include_directories : include_directories('include'),
|
||||||
cpp_args : [
|
cpp_args : [
|
||||||
'-Wall',
|
'-Wall',
|
||||||
|
@ -28,17 +28,20 @@ namespace Data {
|
|||||||
|
|
||||||
const std::vector<fs::path> getSongFolders() {
|
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/")) {
|
for (const auto& dir_item : fs::directory_iterator("songs/")) {
|
||||||
if (dir_item.is_directory()) {
|
if (dir_item.is_directory()) {
|
||||||
for (auto& path : recursiveSongSearch(dir_item.path())) {
|
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) {
|
std::list<fs::path> recursiveSongSearch(fs::path song_or_pack) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user