diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2018-06-20 07:34:54 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2018-06-30 01:30:37 +0800 |
commit | 328554a4f91bbd77fc9a901e0bde66eb16d988ea (patch) | |
tree | 1d6365c17cc0ede81bb951e330ba08c1ca31aed3 /libsolc | |
parent | 7d525620d88d3539b5c0f85ee2c5ba49506e30bc (diff) | |
download | dexon-solidity-328554a4f91bbd77fc9a901e0bde66eb16d988ea.tar.gz dexon-solidity-328554a4f91bbd77fc9a901e0bde66eb16d988ea.tar.zst dexon-solidity-328554a4f91bbd77fc9a901e0bde66eb16d988ea.zip |
Add new libsolc entry points (solidity_license/version/compile)
Diffstat (limited to 'libsolc')
-rw-r--r-- | libsolc/CMakeLists.txt | 2 | ||||
-rw-r--r-- | libsolc/libsolc.cpp | 15 | ||||
-rw-r--r-- | libsolc/libsolc.h | 4 |
3 files changed, 20 insertions, 1 deletions
diff --git a/libsolc/CMakeLists.txt b/libsolc/CMakeLists.txt index e67583dd..63fc1a83 100644 --- a/libsolc/CMakeLists.txt +++ b/libsolc/CMakeLists.txt @@ -1,5 +1,5 @@ if (EMSCRIPTEN) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s EXPORTED_FUNCTIONS='[\"_compileJSON\",\"_license\",\"_version\",\"_compileJSONMulti\",\"_compileJSONCallback\",\"_compileStandard\"]' -s RESERVED_FUNCTION_POINTERS=20") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s EXPORTED_FUNCTIONS='[\"_solidity_license\",\"_solidity_version\",\"_solidity_compile\",\"_license\",\"_version\",\"_compileJSON\",\"_compileJSONMulti\",\"_compileJSONCallback\",\"_compileStandard\"]' -s RESERVED_FUNCTION_POINTERS=20") add_executable(soljson libsolc.cpp) target_link_libraries(soljson PRIVATE solidity) else() diff --git a/libsolc/libsolc.cpp b/libsolc/libsolc.cpp index 6c587e23..26ce98ce 100644 --- a/libsolc/libsolc.cpp +++ b/libsolc/libsolc.cpp @@ -299,4 +299,19 @@ extern char const* compileStandard(char const* _input, CStyleReadFileCallback _r s_outputBuffer = compileStandardInternal(_input, _readCallback); return s_outputBuffer.c_str(); } +extern char const* solidity_license() +{ + /// todo: make this the default or an alias + return license(); +} +extern char const* solidity_version() +{ + /// todo: make this the default or an alias + return version(); +} +extern char const* solidity_compile(char const* _input, CStyleReadFileCallback _readCallback) +{ + /// todo: make this the default or an alias + return compileStandard(_input, _readCallback); +} } diff --git a/libsolc/libsolc.h b/libsolc/libsolc.h index c392ce93..2cc004d4 100644 --- a/libsolc/libsolc.h +++ b/libsolc/libsolc.h @@ -37,6 +37,10 @@ char const* compileJSONMulti(char const* _input, bool _optimize); char const* compileJSONCallback(char const* _input, bool _optimize, CStyleReadFileCallback _readCallback); char const* compileStandard(char const* _input, CStyleReadFileCallback _readCallback); +char const* solidity_license(); +char const* solidity_version(); +char const* solidity_compile(char const* _input, CStyleReadFileCallback _readCallback); + #ifdef __cplusplus } #endif |