diff --git a/CMakeLists.txt b/CMakeLists.txt index 105de8515..8993f372c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -43,9 +43,10 @@ configure_project(TESTS) add_subdirectory(libdevcore) add_subdirectory(libevmasm) add_subdirectory(libsolidity) -add_subdirectory(solc) +add_subdirectory(libsolc) if (NOT EMSCRIPTEN) + add_subdirectory(solc) add_subdirectory(liblll) add_subdirectory(lllc) endif() diff --git a/libsolc/CMakeLists.txt b/libsolc/CMakeLists.txt new file mode 100644 index 000000000..e67583dd2 --- /dev/null +++ b/libsolc/CMakeLists.txt @@ -0,0 +1,9 @@ +if (EMSCRIPTEN) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s EXPORTED_FUNCTIONS='[\"_compileJSON\",\"_license\",\"_version\",\"_compileJSONMulti\",\"_compileJSONCallback\",\"_compileStandard\"]' -s RESERVED_FUNCTION_POINTERS=20") + add_executable(soljson libsolc.cpp) + target_link_libraries(soljson PRIVATE solidity) +else() + add_library(libsolc libsolc.cpp) + set_target_properties(libsolc PROPERTIES OUTPUT_NAME solc) + target_link_libraries(libsolc PRIVATE solidity) +endif() diff --git a/solc/jsonCompiler.cpp b/libsolc/libsolc.cpp similarity index 99% rename from solc/jsonCompiler.cpp rename to libsolc/libsolc.cpp index 23feaa2ae..3a6e15215 100644 --- a/solc/jsonCompiler.cpp +++ b/libsolc/libsolc.cpp @@ -20,7 +20,7 @@ * JSON interface for the solidity compiler to be used from Javascript. */ -#include +#include #include #include #include diff --git a/solc/jsonCompiler.h b/libsolc/libsolc.h similarity index 100% rename from solc/jsonCompiler.h rename to libsolc/libsolc.h diff --git a/scripts/bytecodecompare/storebytecode.sh b/scripts/bytecodecompare/storebytecode.sh index 8d4100bf2..557e3275d 100755 --- a/scripts/bytecodecompare/storebytecode.sh +++ b/scripts/bytecodecompare/storebytecode.sh @@ -40,7 +40,7 @@ TMPDIR=$(mktemp -d) if [[ "$SOLC_EMSCRIPTEN" = "On" ]] then - cp "$REPO_ROOT/build/solc/soljson.js" . + cp "$REPO_ROOT/build/libsolc/soljson.js" . npm install solc cat > solc < #include -#include +#include #include diff --git a/test/libsolidity/JSONCompiler.cpp b/test/libsolidity/JSONCompiler.cpp index 7dc4808bd..0c904c778 100644 --- a/test/libsolidity/JSONCompiler.cpp +++ b/test/libsolidity/JSONCompiler.cpp @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include "../Metadata.h" #include "../TestHelper.h"