mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Adds EMSCRIPTEN preprocessor definition to libsolidity build & avoid accessing filesystem::current_path() if building for Emscripten.
This commit is contained in:
parent
ec6f1758c1
commit
3572d52ace
@ -176,3 +176,7 @@ set(sources
|
|||||||
|
|
||||||
add_library(solidity ${sources})
|
add_library(solidity ${sources})
|
||||||
target_link_libraries(solidity PUBLIC yul evmasm langutil smtutil solutil Boost::boost fmt::fmt-header-only)
|
target_link_libraries(solidity PUBLIC yul evmasm langutil smtutil solutil Boost::boost fmt::fmt-header-only)
|
||||||
|
|
||||||
|
if(EMSCRIPTEN)
|
||||||
|
target_compile_definitions(solidity PRIVATE EMSCRIPTEN=1)
|
||||||
|
endif()
|
||||||
|
@ -244,7 +244,13 @@ boost::filesystem::path FileReader::normalizeCLIPathForVFS(
|
|||||||
// - Preserves case. Even if the filesystem is case-insensitive but case-preserving and the
|
// - Preserves case. Even if the filesystem is case-insensitive but case-preserving and the
|
||||||
// case differs, the actual case from disk is NOT detected.
|
// 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
|
// 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.
|
// Windows it does not. To get consistent results we resolve them on all platforms.
|
||||||
|
Loading…
Reference in New Issue
Block a user