Fix build with gcc-7 on linux (WIP)
Not very clean, needs improvement
This commit is contained in:
parent
a4df74a9d8
commit
52308936ca
5 changed files with 41 additions and 6 deletions
|
|
@ -8,6 +8,8 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND NOT ANDROID)
|
|||
add_compile_options(-stdlib=libc++)
|
||||
# Presumably need the above for linking too, maybe other options missing as well
|
||||
add_link_options(-stdlib=libc++) # New command on CMake master, not in 3.12 release
|
||||
else()
|
||||
add_link_options(-lstdc++fs)
|
||||
endif()
|
||||
|
||||
if (UNIX)
|
||||
|
|
|
|||
|
|
@ -23,8 +23,8 @@
|
|||
|
||||
#include "Parser.h"
|
||||
#include "StringViewHelpers.h"
|
||||
#include "filesystem.h"
|
||||
#include <iostream>
|
||||
#include <filesystem>
|
||||
#include <string_view>
|
||||
#include <absl/flags/parse.h>
|
||||
#include <absl/types/span.h>
|
||||
|
|
@ -92,4 +92,4 @@ int main(int argc, char** argv)
|
|||
std::cout << '\t' << define.first << '=' << define.second << '\n';
|
||||
// spdlog::info("Done!");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,9 +27,9 @@
|
|||
#include "LeakDetector.h"
|
||||
#include "AudioBuffer.h"
|
||||
#include "Voice.h"
|
||||
#include "filesystem.h"
|
||||
#include "readerwriterqueue.h"
|
||||
#include <absl/container/flat_hash_map.h>
|
||||
#include <filesystem>
|
||||
#include <optional>
|
||||
#include <string_view>
|
||||
#include <thread>
|
||||
|
|
@ -75,4 +75,4 @@ private:
|
|||
absl::flat_hash_map<std::string_view, std::shared_ptr<AudioBuffer<float>>> preloadedData;
|
||||
LEAK_DETECTOR(FilePool);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
#pragma once
|
||||
#include "Opcode.h"
|
||||
#include <filesystem>
|
||||
#include "filesystem.h"
|
||||
#include <map>
|
||||
#include <regex>
|
||||
#include <string>
|
||||
|
|
@ -59,4 +59,4 @@ private:
|
|||
void readSfzFile(const std::filesystem::path& fileName, std::vector<std::string>& lines) noexcept;
|
||||
};
|
||||
|
||||
} // namespace sfz
|
||||
} // namespace sfz
|
||||
|
|
|
|||
33
sfizz/filesystem.h
Normal file
33
sfizz/filesystem.h
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
// Copyright (c) 2019, Paul Ferrand
|
||||
// All rights reserved.
|
||||
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are met:
|
||||
|
||||
// 1. Redistributions of source code must retain the above copyright notice, this
|
||||
// list of conditions and the following disclaimer.
|
||||
// 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
// this list of conditions and the following disclaimer in the documentation
|
||||
// and/or other materials provided with the distribution.
|
||||
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||
// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifdef __linux__
|
||||
#include <experimental/filesystem>
|
||||
namespace std {
|
||||
namespace filesystem = std::experimental::filesystem;
|
||||
}
|
||||
#else
|
||||
#include <filesystem>
|
||||
#endif
|
||||
Loading…
Add table
Reference in a new issue