From 1734d4456189b4a313a07e7f3e24cb01f5057fc3 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Sat, 16 Sep 2017 03:50:16 +0100 Subject: [PATCH] Rename jsonCompiler to libsolc --- CMakeLists.txt | 3 ++- libsolc/CMakeLists.txt | 9 +++++++++ solc/jsonCompiler.cpp => libsolc/libsolc.cpp | 2 +- solc/jsonCompiler.h => libsolc/libsolc.h | 0 scripts/bytecodecompare/storebytecode.sh | 2 +- scripts/test_emscripten.sh | 2 +- scripts/travis-emscripten/build_emscripten.sh | 4 ++-- solc/CMakeLists.txt | 8 -------- test/CMakeLists.txt | 4 ++-- test/fuzzer.cpp | 2 +- test/libsolidity/JSONCompiler.cpp | 2 +- 11 files changed, 20 insertions(+), 18 deletions(-) create mode 100644 libsolc/CMakeLists.txt rename solc/jsonCompiler.cpp => libsolc/libsolc.cpp (99%) rename solc/jsonCompiler.h => libsolc/libsolc.h (100%) 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"