2016-08-01 05:25:37 +00:00
|
|
|
function(eth_apply TARGET REQUIRED SUBMODULE)
|
|
|
|
|
|
|
|
set(SOL_DIR "${ETH_CMAKE_DIR}/.." CACHE PATH "The path to the solidity directory")
|
|
|
|
set(SOL_BUILD_DIR_NAME "build" CACHE STRING "The name of the build directory in solidity repo")
|
|
|
|
set(SOL_BUILD_DIR "${SOL_DIR}/${SOL_BUILD_DIR_NAME}")
|
|
|
|
set(CMAKE_LIBRARY_PATH ${SOL_BUILD_DIR};${CMAKE_LIBRARY_PATH})
|
|
|
|
|
|
|
|
find_package(Solidity)
|
|
|
|
|
|
|
|
# Hide confusing blank dependency information when using FindSolidity on itself.
|
|
|
|
if (NOT(${MODULE_MAIN} STREQUAL Solidity))
|
|
|
|
eth_show_dependency(SOLIDITY solidity)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
target_include_directories(${TARGET} PUBLIC ${Solidity_INCLUDE_DIRS})
|
|
|
|
|
2016-08-10 11:17:18 +00:00
|
|
|
if (${SUBMODULE} STREQUAL "solevmasm")
|
2016-10-20 09:58:25 +00:00
|
|
|
target_link_libraries(${TARGET} ${Solidity_SOLEVMASM_LIBRARIES} jsoncpp)
|
2016-08-01 05:25:37 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if (${SUBMODULE} STREQUAL "lll")
|
2016-08-10 11:17:18 +00:00
|
|
|
eth_use(${TARGET} ${REQUIRED} Solidity::solevmasm)
|
2016-08-01 05:25:37 +00:00
|
|
|
target_link_libraries(${TARGET} ${Solidity_LLL_LIBRARIES})
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if (${SUBMODULE} STREQUAL "solidity" OR ${SUBMODULE} STREQUAL "")
|
2016-08-10 11:17:18 +00:00
|
|
|
eth_use(${TARGET} ${REQUIRED} Dev::soldevcore Solidity::solevmasm)
|
2016-08-01 05:25:37 +00:00
|
|
|
target_link_libraries(${TARGET} ${Solidity_SOLIDITY_LIBRARIES})
|
|
|
|
endif()
|
|
|
|
|
|
|
|
target_compile_definitions(${TARGET} PUBLIC ETH_SOLIDITY)
|
|
|
|
endfunction()
|