Set source directory for ScriptCompiler.

This commit is contained in:
Deukhoofd 2021-05-13 12:48:46 +02:00
parent a01d16f3fe
commit d0594d04fc
Signed by: Deukhoofd
GPG Key ID: F63E044490819F6F
1 changed files with 2 additions and 1 deletions

View File

@ -24,6 +24,7 @@ void ScriptCompiler::Compile(const std::string& inPath, const std::string& outPa
auto resolver = new AngelScriptResolver(); auto resolver = new AngelScriptResolver();
auto library = BuildLibrary(resolver); auto library = BuildLibrary(resolver);
resolver->Initialize(library); resolver->Initialize(library);
resolver->SetSourceDirectory(inPath);
for (const auto& dirEntry : recursive_directory_iterator(inPath)) { for (const auto& dirEntry : recursive_directory_iterator(inPath)) {
if (dirEntry.is_regular_file()) { if (dirEntry.is_regular_file()) {
if (dirEntry.path().extension() != ".as") { if (dirEntry.path().extension() != ".as") {
@ -53,7 +54,7 @@ void ScriptCompiler::Compile(const std::string& inPath, const std::string& outPa
} }
std::cout << "\t===" << std::endl; std::cout << "\t===" << std::endl;
for (const auto& s: type.second){ for (const auto& s : type.second) {
std::cout << s.first << std::endl; std::cout << s.first << std::endl;
} }
} }