blob: 8db2f848598c36f5abb4b688f68bee53a7214421 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
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})
if (${SUBMODULE} STREQUAL "evmasm")
eth_use(${TARGET} ${REQUIRED} )
target_link_libraries(${TARGET} ${Solidity_EVMASM_LIBRARIES})
endif()
if (${SUBMODULE} STREQUAL "lll")
eth_use(${TARGET} ${REQUIRED} Solidity::evmasm)
target_link_libraries(${TARGET} ${Solidity_LLL_LIBRARIES})
endif()
if (${SUBMODULE} STREQUAL "solidity" OR ${SUBMODULE} STREQUAL "")
eth_use(${TARGET} ${REQUIRED} Dev::soldevcore Solidity::evmasm)
target_link_libraries(${TARGET} ${Solidity_SOLIDITY_LIBRARIES})
endif()
target_compile_definitions(${TARGET} PUBLIC ETH_SOLIDITY)
endfunction()
|