fix(library/native_compiler): get_exe_location does not exist on emscripten

This commit is contained in:
Gabriel Ebner 2016-12-31 15:15:20 +01:00
parent a06d9adfec
commit 6fa246032f
2 changed files with 6 additions and 0 deletions

View file

@ -51,8 +51,12 @@ expr mk_local(name const & n) {
void initialize_install_path() {
// 8 is the size of the string bin/lean which we want to remove from
// the installed version of Lean.
#if defined(LEAN_EMSCRIPTEN)
g_lean_install_path = new std::string;
#else
auto path = get_exe_location();
g_lean_install_path = new std::string(path.substr(0, path.size() - 8));
#endif
}
std::string get_install_path() {

View file

@ -20,7 +20,9 @@ public:
/** \brief Initialize the lean_path */
void init_lean_path();
#if !defined(LEAN_EMSCRIPTEN)
std::string get_exe_location();
#endif
/** \brief Return the LEAN_PATH string */
char const * get_lean_path();