fix(tests/shell): fix build

This commit is contained in:
Gabriel Ebner 2016-10-16 11:26:52 -04:00 committed by Leonardo de Moura
parent a7fe8cf15c
commit 6d7cf7bace
4 changed files with 33 additions and 23 deletions

View file

@ -2,9 +2,11 @@ add_executable(lean lean.cpp json.cpp server.cpp)
target_link_libraries(lean leanstatic)
install(TARGETS lean DESTINATION bin)
add_executable(lean_js lean_js.cpp)
add_executable(lean_js lean_js.cpp lean_js_main.cpp)
target_link_libraries(lean_js leanstatic)
add_library(shell_js OBJECT lean_js.cpp)
if(${EMSCRIPTEN})
target_link_libraries(lean "--memory-init-file 0")

View file

@ -81,23 +81,3 @@ int emscripten_import_module(std::string mname) {
int emscripten_process_file(std::string input_filename) {
return g_shell->process_file(input_filename);
}
#if defined(LEAN_EMSCRIPTEN)
#include <emscripten/bind.h>
EMSCRIPTEN_BINDINGS(LEAN_JS) {
emscripten::function("lean_init", &initialize_emscripten);
emscripten::function("lean_import_module", &emscripten_import_module);
emscripten::function("lean_process_file", &emscripten_process_file);
}
int main() { return 0; }
#else
int main(int, char **) {
initialize_emscripten();
emscripten_import_module("standard");
}
#endif

View file

@ -0,0 +1,28 @@
/*
Copyright (c) 2015 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Author: Leonardo de Moura
*/
#include <string>
#include "shell/lean_js.h"
#if defined(LEAN_EMSCRIPTEN)
#include <emscripten/bind.h>
EMSCRIPTEN_BINDINGS(LEAN_JS) {
emscripten::function("lean_init", &initialize_emscripten);
emscripten::function("lean_import_module", &emscripten_import_module);
emscripten::function("lean_process_file", &emscripten_process_file);
}
int main() { return 0; }
#else
int main(int, char **) {
initialize_emscripten();
emscripten_import_module("standard");
}
#endif

View file

@ -1,5 +1,5 @@
add_executable(shell_test shell.cpp ${LEAN_OBJS})
target_link_libraries(shell_test ${EXTRA_LIBS})
add_executable(shell_test shell.cpp $<TARGET_OBJECTS:shell_js>)
target_link_libraries(shell_test leanstatic)
# TODO(Leo): add after stdlib is activated again
# add_test(NAME "emscripten_test"