Adds EMSCRIPTEN preprocessor definition to libsolidity build & avoid accessing filesystem::current_path() if building for Emscripten.

This commit is contained in:
Christian Parpart
2022-03-15 11:48:29 +01:00
parent ec6f1758c1
commit 3572d52ace
2 changed files with 11 additions and 1 deletions
+7 -1
View File
@@ -244,7 +244,13 @@ boost::filesystem::path FileReader::normalizeCLIPathForVFS(
// - Preserves case. Even if the filesystem is case-insensitive but case-preserving and the
// case differs, the actual case from disk is NOT detected.
boost::filesystem::path canonicalWorkDir = boost::filesystem::weakly_canonical(boost::filesystem::current_path());
boost::filesystem::path canonicalWorkDir =
#if defined(EMSCRIPTEN)
boost::filesystem::path("/")
#else
boost::filesystem::weakly_canonical(boost::filesystem::current_path())
#endif
;
// NOTE: On UNIX systems the path returned from current_path() has symlinks resolved while on
// Windows it does not. To get consistent results we resolve them on all platforms.