Skip to content

Commit

Permalink
core: use blst from evmone
Browse files Browse the repository at this point in the history
  • Loading branch information
chfast committed Sep 24, 2024
1 parent 00c7131 commit b6eea35
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 58 deletions.
2 changes: 1 addition & 1 deletion cmd/dev/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ target_include_directories(grpc_toolbox PRIVATE ${CMAKE_SOURCE_DIR})
target_link_libraries(grpc_toolbox absl::flags_parse gRPC::grpc++ protobuf::libprotobuf silkworm_rpcdaemon)

add_executable(kzg_g2_uncompress kzg_g2_uncompress.cpp)
target_link_libraries(kzg_g2_uncompress silkworm_core blst)
target_link_libraries(kzg_g2_uncompress silkworm_core blst::blst)

add_executable(scan_txs scan_txs.cpp)
target_link_libraries(scan_txs PRIVATE silkworm_node CLI11::CLI11 absl::time)
Expand Down
2 changes: 1 addition & 1 deletion silkworm/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ set(SILKWORM_CORE_PUBLIC_LIBS
secp256k1
tl::expected
)
set(SILKWORM_CORE_PRIVATE_LIBS ff blst)
set(SILKWORM_CORE_PRIVATE_LIBS ff blst::blst)

if(SILKWORM_CORE_USE_ABSEIL)
find_package(absl REQUIRED)
Expand Down
56 changes: 1 addition & 55 deletions third_party/blst/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,55 +1 @@
#[[
Copyright 2022 The Silkworm Authors

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
]]

include(ExternalProject)

set(BLST_DIR ${CMAKE_CURRENT_SOURCE_DIR}/blst)
if(SILKWORM_WASM_API)
set(BLST_BUILD_SCRIPT ./build.sh CC=/opt/wasi-sdk/bin/clang -D__BLST_PORTABLE__)
set(BLST_LIB libblst.a)
elseif(MSVC)
set(BLST_BUILD_SCRIPT build.bat)
set(BLST_LIB blst.lib)
else()
set(BLST_BUILD_SCRIPT_ARGS "")
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
set(BLST_BUILD_SCRIPT_ARGS "-mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}")
endif()
set(BLST_BUILD_SCRIPT ./build.sh ${BLST_BUILD_SCRIPT_ARGS})
set(BLST_LIB libblst.a)
endif()

ExternalProject_Add(
blst_build
SOURCE_DIR ${BLST_DIR}
CONFIGURE_COMMAND ""
BUILD_COMMAND ${BLST_BUILD_SCRIPT}
BUILD_IN_SOURCE 1
BUILD_BYPRODUCTS ${BLST_DIR}/${BLST_LIB}
LOG_BUILD YES
LOG_OUTPUT_ON_FAILURE YES
INSTALL_COMMAND ""
)

add_library(blst STATIC IMPORTED GLOBAL)
add_dependencies(blst blst_build)
# cmake-format: off
set_target_properties(
blst
PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${BLST_DIR}/bindings
IMPORTED_LOCATION ${BLST_DIR}/${BLST_LIB}
)
# cmake-format: on
include(../evmone/evmone/cmake/blst.cmake)
1 change: 0 additions & 1 deletion third_party/blst/blst
Submodule blst deleted from 3dd0f8

0 comments on commit b6eea35

Please sign in to comment.