Skip to content

Commit

Permalink
Merge pull request ethereum#3010 from ethereum/libsolc
Browse files Browse the repository at this point in the history
Rename jsonCompiler to libsolc
  • Loading branch information
axic authored Dec 12, 2017
2 parents 539b8f3 + 1734d44 commit 1ddd4e2
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 18 deletions.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
9 changes: 9 additions & 0 deletions libsolc/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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()
2 changes: 1 addition & 1 deletion solc/jsonCompiler.cpp → libsolc/libsolc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* JSON interface for the solidity compiler to be used from Javascript.
*/

#include <solc/jsonCompiler.h>
#include <libsolc/libsolc.h>
#include <libdevcore/Common.h>
#include <libdevcore/JSON.h>
#include <libsolidity/interface/StandardCompiler.h>
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion scripts/bytecodecompare/storebytecode.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 <<EOF
#!/usr/bin/env node
Expand Down
2 changes: 1 addition & 1 deletion scripts/test_emscripten.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
set -e

REPO_ROOT=$(cd $(dirname "$0")/.. && pwd)
SOLJSON="$REPO_ROOT/build/solc/soljson.js"
SOLJSON="$REPO_ROOT/build/libsolc/soljson.js"

DIR=$(mktemp -d)
(
Expand Down
4 changes: 2 additions & 2 deletions scripts/travis-emscripten/build_emscripten.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ make -j 4

cd ..
mkdir -p upload
cp build/solc/soljson.js upload/
cp build/solc/soljson.js ./
cp build/libsolc/soljson.js upload/
cp build/libsolc/soljson.js ./

OUTPUT_SIZE=`ls -la soljson.js`

Expand Down
8 changes: 0 additions & 8 deletions solc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,6 @@ target_link_libraries(solc PRIVATE solidity ${Boost_PROGRAM_OPTIONS_LIBRARIES})
include(GNUInstallDirs)
install(TARGETS solc DESTINATION "${CMAKE_INSTALL_BINDIR}")

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 jsonCompiler.cpp)
else()
add_library(soljson jsonCompiler.cpp)
endif()
target_link_libraries(soljson PRIVATE solidity)

if(SOLC_LINK_STATIC AND UNIX AND NOT APPLE)
# Produce solc as statically linked binary (includes C/C++ standard libraries)
# This is not supported on macOS, see
Expand Down
4 changes: 2 additions & 2 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ list(REMOVE_ITEM sources "${CMAKE_CURRENT_SOURCE_DIR}/fuzzer.cpp")
file(GLOB_RECURSE headers "*.h")

add_executable(soltest ${sources} ${headers})
target_link_libraries(soltest PRIVATE soljson solidity lll evmasm devcore ${Boost_UNIT_TEST_FRAMEWORK_LIBRARIES})
target_link_libraries(soltest PRIVATE libsolc solidity lll evmasm devcore ${Boost_UNIT_TEST_FRAMEWORK_LIBRARIES})

add_executable(solfuzzer fuzzer.cpp)
target_link_libraries(solfuzzer soljson evmasm ${Boost_PROGRAM_OPTIONS_LIBRARIES})
target_link_libraries(solfuzzer PRIVATE libsolc evmasm ${Boost_PROGRAM_OPTIONS_LIBRARIES})
2 changes: 1 addition & 1 deletion test/fuzzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

#include <libevmasm/Assembly.h>
#include <libevmasm/ConstantOptimiser.h>
#include <solc/jsonCompiler.h>
#include <libsolc/libsolc.h>

#include <json/json.h>

Expand Down
2 changes: 1 addition & 1 deletion test/libsolidity/JSONCompiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include <boost/test/unit_test.hpp>
#include <libdevcore/JSON.h>
#include <libsolidity/interface/Version.h>
#include <solc/jsonCompiler.h>
#include <libsolc/libsolc.h>

#include "../Metadata.h"
#include "../TestHelper.h"
Expand Down

0 comments on commit 1ddd4e2

Please sign in to comment.