2017-09-16 02:50:16 +00:00
|
|
|
if (EMSCRIPTEN)
|
2022-03-07 12:31:55 +00:00
|
|
|
CreateExportedFunctionsForEMSDK(
|
|
|
|
ExportedFunctions
|
|
|
|
solidity_license
|
|
|
|
solidity_version
|
|
|
|
solidity_compile
|
|
|
|
solidity_alloc
|
|
|
|
solidity_free
|
|
|
|
solidity_reset
|
|
|
|
)
|
2018-07-11 15:15:03 +00:00
|
|
|
# Specify which functions to export in soljson.js.
|
|
|
|
# Note that additional Emscripten-generated methods needed by solc-js are
|
|
|
|
# defined to be exported in cmake/EthCompilerSettings.cmake.
|
2022-03-07 12:31:55 +00:00
|
|
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s EXPORTED_FUNCTIONS='${ExportedFunctions}'")
|
2018-12-17 14:00:39 +00:00
|
|
|
add_executable(soljson libsolc.cpp libsolc.h)
|
2017-09-16 02:50:16 +00:00
|
|
|
target_link_libraries(soljson PRIVATE solidity)
|
|
|
|
else()
|
2018-12-17 14:00:39 +00:00
|
|
|
add_library(libsolc libsolc.cpp libsolc.h)
|
2017-09-16 02:50:16 +00:00
|
|
|
set_target_properties(libsolc PROPERTIES OUTPUT_NAME solc)
|
|
|
|
target_link_libraries(libsolc PRIVATE solidity)
|
|
|
|
endif()
|