mirror of
https://github.com/ton-blockchain/ton
synced 2025-02-13 03:32:22 +00:00
* fix build * nix flake * nix package * static musl build env * make all builds in static env * GH Actions nightly and static workflows * deb package * cmake install {adnl-proxy,blockchain-explorer,create-state,http-proxy,rldp-http-proxy,storage-cli} * nix flake: add static glibc build variant * GH Actions: deb-nightly-{musl,glibc_static}, tests-rolling jobs * rpm package * build blockchain-explorer * GH Actions: deb_rpm-nightly: ubuntu-{latest=>22.04} * crypto/pow-miner: skip install * ghactions: tests-rolling: show tests run, progress * ghactions: deb_rpm-nightly: add manual trigger [skip ci] * nix flake refactor * find_package=>pkg-config(zlib) FindZLIB.cmake can't find static zlib prior to CMake 3.24, so use pkg-config. * nix old glibc build * nix aarch64 support * packages: Populate APT and RPM repos at ton-repo - {deb,rpm}.sh: Separate build and install dirs - rpm.sh: Conditionally include lib/ - Accomodate local CI runs w/act * [skip ci] README packages * fix aarch64 build -Wnoerror=address * [skip ci] rpm set releasever * [skip ci] document local packages upload * m1 build: gate cpu=apple-m1 by clang version * packages: Ship musl binaries + old glibc dylibs * packages: macos build * nix: bump nixpkgs * fix windows CI build * [skip ci] nix: static aarch64 builds * packages: deb,rpm multiarch * ghactions: aarch64 musl deb,rpm build * [skip ci] deb build: deref source links, -x * [skip ci] nix darwin static build * [skip ci] nix common hostPkgs * [skip ci] brew: move formula over to homebrew-ton-repo * [skip ci] nix fix aarch64-linux build * [skip ci] ghactions: nix use GITHUB_TOKEN * [skip ci] Move from ton-repo to gh releases * [skip ci] ghactions aarch64-darwin self-hosted runner * [skip ci] ghactions deb,rpm nightly 10h timeout * [skip ci] fix brew install fixes Errno::EACCES: Permission denied @ dir_s_mkdir - /private/tmp/ton-XXX/bin/.brew_home * [skip ci] ghactions deb,rpm nightly: don't upload ton-packages as we gh release them later * [skip ci] README: brew instructions * [skip ci] nightly linux binaries release * [skip ci] packages: ship macos dylib * [skip ci] ghactions: Run Windows build nightly, upload to gh releases * nix: remove defaultPackage, switch to different oldglibc build method We used to rebuild nixpkgs-stable with old glibc, which broke on aarch64 due to its particular bootstrap toolchain. This just takes nixos 19.09's version of GCC but new dependencies, sidestepping the issue. * fix rpm release, add aur release * fix local (act) ci run * ghactions: linux-nightly: Print out SSH public keys * ghactions: bump cachix actions * nix: default devShell * [skip ci] rpm,aur: Ship lib * [skip ci] packages: windows: Remove CMake files from out * [skip ci] packages: Import chocolatey package * fixup! fix rpm release, add aur release * [skip ci] packages: aarch64-linux: build dylib as well * [skip ci] ghactions: run on self-hosted * [skip ci] ghactions: windows-nightly: Bump nodejs actions * [skip ci] nix: Only add Linux packaging tools on Linux * [skip ci] doc: document direct download binaries in README * fix tonlib android jni ci * fixup! fix tonlib android jni ci * [skip ci] ghactions: Update GH release dates Errata: doesn't update tags. * [skip ci] ghactions: Fix racy brew gh release by splitting arch * initiali commit - binaries only * fixes * fixes * fixes * fixes * remove packages dir for now * add storage-daemon storage-daemon-cli * fix emulator * try macos aarch64 * try macos aarch64 * try macos aarch64 * try macos aarch64 * try macos aarch64 * try macos aarch64 * try macos aarch64 * try macos aarch64 * try macos aarch64 * try macos aarch64 * try macos aarch64 sh * try macos aarch64 sh * try macos aarch64 bash * try macos aarch64 bash * try macos aarch64 bash * try macos aarch64 bash * try macos aarch64 bash * try macos aarch64 bash * try macos aarch64 bash * fix funcfiftlib compilation with emscripten * fix funcfiftlib compilation with emscripten * add github action to compile TON with emscripten * add github action to compile TON with emscripten * add github action to compile TON with emscripten * add github action to compile TON with emscripten * add github action to compile TON with emscripten * add github action to compile TON with emscripten * try macos aarch64 * fix funcfiftlib compilation with emscripten * fix funcfiftlib compilation with emscripten * add github action to compile TON with emscripten * disable aarch64 github actions for now * disable aarch64 github actions for now * trigger all GH actions * trigger all GH actions 2 * trigger all GH actions 3 * trigger all GH actions 4 * trigger all GH actions 5 * put back rldp-http-proxy to win build * put back rldp-http-proxy to win build * dont use pkgConfig for zlib * fix zlib_library * use BUILD_SHARED_LIBS flag for static compilation * test 1 * test 2 * add wasm binaries to release. test 3 * add simple binaries' execution test * build emulator-emscripten * build and add into artifacts wasm tlbc and emulator-emscripten * build and add into artifacts wasm tlbc and emulator-emscripten, 2 * build and add into artifacts wasm tlbc and emulator-emscripten, 3 * build and add into artifacts wasm tlbc and emulator-emscripten, 4 * build emulator-emscripten with static libs * minor nix mac aarch64 fix * add single artifacts to release * bypass $repo to Dockerfile * add wasm artifacts to release * add wasm artifacts to release * add wasm artifacts to release * add wasm artifacts to release * add more artifacts to release; remove compilation against Ubuntu 18.04. * retrieve GITHUB_TOKEN for ton-blockchain/ton * remove binary check for arm64 --------- Co-authored-by: tonthemoon <tonthemoon@mailbox.org>
493 lines
15 KiB
CMake
493 lines
15 KiB
CMake
cmake_minimum_required(VERSION 3.0.2 FATAL_ERROR)
|
|
|
|
if (NOT OPENSSL_FOUND)
|
|
find_package(OpenSSL REQUIRED)
|
|
endif()
|
|
|
|
set(TON_CRYPTO_SOURCE
|
|
Ed25519.cpp
|
|
common/bigint.cpp
|
|
common/refcnt.cpp
|
|
common/refint.cpp
|
|
common/bigexp.cpp
|
|
common/bitstring.cpp
|
|
common/util.cpp
|
|
ellcurve/Ed25519.cpp
|
|
ellcurve/Fp25519.cpp
|
|
ellcurve/Montgomery.cpp
|
|
ellcurve/TwEdwards.cpp
|
|
openssl/bignum.cpp
|
|
openssl/residue.cpp
|
|
openssl/rand.cpp
|
|
vm/stack.cpp
|
|
vm/atom.cpp
|
|
vm/continuation.cpp
|
|
vm/dict.cpp
|
|
vm/memo.cpp
|
|
vm/dispatch.cpp
|
|
vm/opctable.cpp
|
|
vm/cp0.cpp
|
|
vm/stackops.cpp
|
|
vm/tupleops.cpp
|
|
vm/arithops.cpp
|
|
vm/cellops.cpp
|
|
vm/contops.cpp
|
|
vm/dictops.cpp
|
|
vm/debugops.cpp
|
|
vm/tonops.cpp
|
|
vm/boc.cpp
|
|
vm/large-boc-serializer.cpp
|
|
vm/utils.cpp
|
|
vm/vm.cpp
|
|
tl/tlblib.cpp
|
|
|
|
Ed25519.h
|
|
common/AtomicRef.h
|
|
common/bigint.hpp
|
|
common/bitstring.h
|
|
common/refcnt.hpp
|
|
common/refint.h
|
|
common/bigexp.h
|
|
common/util.h
|
|
common/linalloc.hpp
|
|
common/promiseop.hpp
|
|
|
|
ellcurve/Ed25519.h
|
|
ellcurve/Fp25519.h
|
|
ellcurve/Montgomery.h
|
|
ellcurve/TwEdwards.h
|
|
|
|
openssl/bignum.h
|
|
openssl/digest.hpp
|
|
openssl/rand.hpp
|
|
openssl/residue.h
|
|
|
|
tl/tlbc-aux.h
|
|
tl/tlbc-data.h
|
|
tl/tlblib.hpp
|
|
|
|
vm/arithops.h
|
|
vm/atom.h
|
|
vm/boc.h
|
|
vm/boc-writers.h
|
|
vm/box.hpp
|
|
vm/cellops.h
|
|
vm/continuation.h
|
|
vm/contops.h
|
|
vm/cp0.h
|
|
vm/debugops.h
|
|
vm/dict.h
|
|
vm/dictops.h
|
|
vm/excno.hpp
|
|
vm/fmt.hpp
|
|
vm/log.h
|
|
vm/memo.h
|
|
vm/opctable.h
|
|
vm/stack.hpp
|
|
vm/stackops.h
|
|
vm/tupleops.h
|
|
vm/tonops.h
|
|
vm/vmstate.h
|
|
vm/utils.h
|
|
vm/vm.h
|
|
|
|
vm/cells.h
|
|
vm/cellslice.h
|
|
|
|
vm/cells/Cell.cpp
|
|
vm/cells/CellBuilder.cpp
|
|
vm/cells/CellHash.cpp
|
|
vm/cells/CellSlice.cpp
|
|
vm/cells/CellString.cpp
|
|
vm/cells/CellTraits.cpp
|
|
vm/cells/CellUsageTree.cpp
|
|
vm/cells/DataCell.cpp
|
|
vm/cells/LevelMask.cpp
|
|
vm/cells/MerkleProof.cpp
|
|
vm/cells/MerkleUpdate.cpp
|
|
|
|
vm/cells/Cell.h
|
|
vm/cells/CellBuilder.h
|
|
vm/cells/CellHash.h
|
|
vm/cells/CellSlice.h
|
|
vm/cells/CellString.h
|
|
vm/cells/CellTraits.h
|
|
vm/cells/CellUsageTree.h
|
|
vm/cells/CellWithStorage.h
|
|
vm/cells/DataCell.h
|
|
vm/cells/ExtCell.h
|
|
vm/cells/LevelMask.h
|
|
vm/cells/MerkleProof.h
|
|
vm/cells/MerkleUpdate.h
|
|
vm/cells/PrunnedCell.h
|
|
vm/cells/UsageCell.h
|
|
vm/cells/VirtualCell.h
|
|
vm/cells/VirtualizationParameters.h
|
|
|
|
vm/db/StaticBagOfCellsDb.h
|
|
vm/db/StaticBagOfCellsDb.cpp
|
|
)
|
|
|
|
set(TON_DB_SOURCE
|
|
vm/db/DynamicBagOfCellsDb.cpp
|
|
vm/db/CellStorage.cpp
|
|
vm/db/TonDb.cpp
|
|
|
|
vm/db/DynamicBagOfCellsDb.h
|
|
vm/db/CellHashTable.h
|
|
vm/db/CellStorage.h
|
|
vm/db/TonDb.h
|
|
)
|
|
|
|
set(FIFT_SOURCE
|
|
fift/Dictionary.cpp
|
|
fift/Fift.cpp
|
|
fift/IntCtx.cpp
|
|
fift/Continuation.cpp
|
|
fift/SourceLookup.cpp
|
|
fift/utils.cpp
|
|
fift/words.cpp
|
|
|
|
fift/Dictionary.h
|
|
fift/Fift.h
|
|
fift/IntCtx.h
|
|
fift/Continuation.h
|
|
fift/SourceLookup.h
|
|
fift/utils.h
|
|
fift/words.h
|
|
)
|
|
|
|
set(PARSER_SOURCE
|
|
parser/srcread.cpp
|
|
parser/lexer.cpp
|
|
parser/symtable.cpp
|
|
|
|
parser/srcread.h
|
|
parser/lexer.h
|
|
parser/symtable.h
|
|
)
|
|
|
|
set(FUNC_LIB_SOURCE
|
|
func/keywords.cpp
|
|
func/unify-types.cpp
|
|
func/parse-func.cpp
|
|
func/abscode.cpp
|
|
func/gen-abscode.cpp
|
|
func/analyzer.cpp
|
|
func/asmops.cpp
|
|
func/builtins.cpp
|
|
func/stack-transform.cpp
|
|
func/optimize.cpp
|
|
func/codegen.cpp
|
|
func/func.cpp
|
|
)
|
|
|
|
set(TLB_BLOCK_AUTO
|
|
${CMAKE_CURRENT_SOURCE_DIR}/block/block-auto.cpp
|
|
${CMAKE_CURRENT_SOURCE_DIR}/block/block-auto.h
|
|
)
|
|
|
|
set(BLOCK_SOURCE
|
|
block/Binlog.h
|
|
block/Binlog.cpp
|
|
block/block.cpp
|
|
block/block-db.cpp
|
|
block/block-parse.cpp
|
|
block/check-proof.cpp
|
|
block/mc-config.cpp
|
|
block/output-queue-merger.cpp
|
|
block/transaction.cpp
|
|
${TLB_BLOCK_AUTO}
|
|
|
|
block/block-binlog.h
|
|
block/block-db-impl.h
|
|
block/block-db.h
|
|
block/block.h
|
|
block/block-parse.h
|
|
block/check-proof.h
|
|
block/output-queue-merger.h
|
|
block/transaction.h
|
|
)
|
|
|
|
set(SMC_ENVELOPE_SOURCE
|
|
smc-envelope/GenericAccount.cpp
|
|
smc-envelope/HighloadWallet.cpp
|
|
smc-envelope/HighloadWalletV2.cpp
|
|
smc-envelope/ManualDns.cpp
|
|
smc-envelope/MultisigWallet.cpp
|
|
smc-envelope/PaymentChannel.cpp
|
|
smc-envelope/SmartContract.cpp
|
|
smc-envelope/SmartContractCode.cpp
|
|
smc-envelope/WalletInterface.cpp
|
|
smc-envelope/WalletV3.cpp
|
|
|
|
smc-envelope/GenericAccount.h
|
|
smc-envelope/HighloadWallet.h
|
|
smc-envelope/HighloadWalletV2.h
|
|
smc-envelope/ManualDns.h
|
|
smc-envelope/MultisigWallet.h
|
|
smc-envelope/SmartContract.h
|
|
smc-envelope/SmartContractCode.h
|
|
smc-envelope/WalletInterface.h
|
|
smc-envelope/WalletV3.h
|
|
)
|
|
|
|
set(ED25519_TEST_SOURCE
|
|
${CMAKE_CURRENT_SOURCE_DIR}/test/Ed25519.cpp
|
|
PARENT_SCOPE
|
|
)
|
|
|
|
set(TONDB_TEST_SOURCE
|
|
${CMAKE_CURRENT_SOURCE_DIR}/test/test-db.cpp
|
|
PARENT_SCOPE
|
|
)
|
|
|
|
set(CELLS_TEST_SOURCE
|
|
${CMAKE_CURRENT_SOURCE_DIR}/test/test-cells.cpp
|
|
PARENT_SCOPE
|
|
)
|
|
|
|
set(TONVM_TEST_SOURCE
|
|
${CMAKE_CURRENT_SOURCE_DIR}/test/vm.cpp
|
|
PARENT_SCOPE
|
|
)
|
|
|
|
set(SMARTCONT_TEST_SOURCE
|
|
${CMAKE_CURRENT_SOURCE_DIR}/test/test-smartcont.cpp
|
|
PARENT_SCOPE
|
|
)
|
|
|
|
set(FIFT_TEST_SOURCE
|
|
${CMAKE_CURRENT_SOURCE_DIR}/test/fift.cpp
|
|
PARENT_SCOPE
|
|
)
|
|
|
|
set(BIGINT_TEST_SOURCE
|
|
${CMAKE_CURRENT_SOURCE_DIR}/test/test-bigint.cpp
|
|
PARENT_SCOPE
|
|
)
|
|
|
|
set(USE_EMSCRIPTEN ${USE_EMSCRIPTEN} PARENT_SCOPE)
|
|
|
|
|
|
add_library(ton_crypto STATIC ${TON_CRYPTO_SOURCE})
|
|
target_include_directories(ton_crypto PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>)
|
|
target_link_libraries(ton_crypto PUBLIC ${OPENSSL_CRYPTO_LIBRARY} tdutils tddb_utils)
|
|
if (USE_EMSCRIPTEN)
|
|
target_link_options(ton_crypto PRIVATE -fexceptions)
|
|
target_compile_options(ton_crypto PRIVATE -fexceptions)
|
|
endif()
|
|
if (NOT WIN32)
|
|
find_library(DL dl)
|
|
if (DL)
|
|
target_link_libraries(ton_crypto PUBLIC dl z)
|
|
else()
|
|
target_link_libraries(ton_crypto PUBLIC z)
|
|
endif()
|
|
endif()
|
|
target_include_directories(ton_crypto SYSTEM PUBLIC $<BUILD_INTERFACE:${OPENSSL_INCLUDE_DIR}>)
|
|
|
|
add_library(ton_db STATIC ${TON_DB_SOURCE})
|
|
target_include_directories(ton_db PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>)
|
|
target_link_libraries(ton_db PUBLIC tdutils tddb ton_crypto)
|
|
|
|
add_executable(test-ed25519-crypto test/test-ed25519-crypto.cpp)
|
|
target_include_directories(test-ed25519-crypto PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
|
|
target_link_libraries(test-ed25519-crypto PUBLIC ton_crypto)
|
|
|
|
add_library(fift-lib ${FIFT_SOURCE})
|
|
target_include_directories(fift-lib PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
|
|
target_link_libraries(fift-lib PUBLIC ton_crypto ton_db tdutils ton_block)
|
|
set_target_properties(fift-lib PROPERTIES OUTPUT_NAME fift)
|
|
|
|
add_executable(fift fift/fift-main.cpp)
|
|
target_link_libraries(fift PUBLIC fift-lib git)
|
|
if (WINGETOPT_FOUND)
|
|
target_link_libraries_system(fift wingetopt)
|
|
endif()
|
|
|
|
add_library(src_parser ${PARSER_SOURCE})
|
|
target_include_directories(src_parser PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
|
|
target_link_libraries(src_parser PUBLIC ton_crypto)
|
|
|
|
add_library(ton_block ${BLOCK_SOURCE})
|
|
target_include_directories(ton_block PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/block> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>)
|
|
target_link_libraries(ton_block PUBLIC ton_crypto tdutils tdactor tl_api)
|
|
|
|
add_executable(func func/func-main.cpp ${FUNC_LIB_SOURCE})
|
|
target_include_directories(func PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
|
|
target_link_libraries(func PUBLIC ton_crypto src_parser git ton_block)
|
|
if (WINGETOPT_FOUND)
|
|
target_link_libraries_system(func wingetopt)
|
|
endif()
|
|
|
|
if (USE_EMSCRIPTEN)
|
|
add_executable(funcfiftlib funcfiftlib/funcfiftlib.cpp ${FUNC_LIB_SOURCE})
|
|
target_include_directories(funcfiftlib PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
|
|
target_link_libraries(funcfiftlib PUBLIC fift-lib src_parser git)
|
|
target_link_options(funcfiftlib PRIVATE -sEXPORTED_RUNTIME_METHODS=FS,ccall,cwrap,_malloc,free,UTF8ToString,stringToUTF8)
|
|
target_link_options(funcfiftlib PRIVATE -sEXPORTED_FUNCTIONS=_func_compile,_version)
|
|
target_link_options(funcfiftlib PRIVATE -sEXPORT_NAME=CompilerModule)
|
|
target_link_options(funcfiftlib PRIVATE -sERROR_ON_UNDEFINED_SYMBOLS=0)
|
|
target_link_options(funcfiftlib PRIVATE -sFILESYSTEM=1)
|
|
target_link_options(funcfiftlib PRIVATE -Oz)
|
|
target_link_options(funcfiftlib PRIVATE -sIGNORE_MISSING_MAIN=1)
|
|
target_link_options(funcfiftlib PRIVATE -sAUTO_NATIVE_LIBRARIES=0)
|
|
target_link_options(funcfiftlib PRIVATE -sMODULARIZE=1)
|
|
target_link_options(funcfiftlib PRIVATE --embed-file ${CMAKE_CURRENT_SOURCE_DIR}/fift/lib@/fiftlib)
|
|
target_compile_options(funcfiftlib PRIVATE -sDISABLE_EXCEPTION_CATCHING=0)
|
|
endif()
|
|
|
|
add_executable(tlbc tl/tlbc.cpp)
|
|
target_include_directories(tlbc PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
|
|
target_link_libraries(tlbc PUBLIC ton_crypto src_parser)
|
|
if (WINGETOPT_FOUND)
|
|
target_link_libraries_system(tlbc wingetopt)
|
|
endif()
|
|
|
|
add_library(pow-miner-lib util/Miner.cpp util/Miner.h)
|
|
target_include_directories(pow-miner-lib PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
|
|
target_link_libraries(pow-miner-lib PUBLIC ton_crypto ton_block)
|
|
|
|
add_executable(pow-miner util/pow-miner.cpp)
|
|
target_link_libraries(pow-miner PRIVATE ton_crypto ton_block pow-miner-lib git)
|
|
|
|
if (WINGETOPT_FOUND)
|
|
target_link_libraries_system(fift wingetopt)
|
|
target_link_libraries_system(pow-miner wingetopt)
|
|
endif()
|
|
|
|
set(TURN_OFF_LSAN cd .)
|
|
if (TON_USE_ASAN AND NOT WIN32)
|
|
set(TURN_OFF_LSAN export LSAN_OPTIONS=detect_leaks=0)
|
|
endif()
|
|
|
|
file(MAKE_DIRECTORY smartcont/auto)
|
|
if (NOT CMAKE_CROSSCOMPILING OR USE_EMSCRIPTEN)
|
|
set(GENERATE_TLB_CMD tlbc)
|
|
if (NOT USE_EMSCRIPTEN)
|
|
add_custom_command(
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/block
|
|
COMMAND ${TURN_OFF_LSAN}
|
|
COMMAND ${GENERATE_TLB_CMD} -o block-auto -n block::gen -z block.tlb
|
|
COMMENT "Generate block tlb source files"
|
|
OUTPUT ${TLB_BLOCK_AUTO}
|
|
DEPENDS tlbc block/block.tlb
|
|
)
|
|
else()
|
|
add_custom_command(
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/block
|
|
COMMAND ${TURN_OFF_LSAN}
|
|
COMMENT "Generate block tlb source files"
|
|
OUTPUT ${TLB_BLOCK_AUTO}
|
|
DEPENDS tlbc block/block.tlb
|
|
)
|
|
endif()
|
|
add_custom_target(tlb_generate_block DEPENDS ${TLB_BLOCK_AUTO})
|
|
add_dependencies(ton_block tlb_generate_block)
|
|
|
|
add_custom_target(gen_fif ALL)
|
|
function(GenFif)
|
|
set(options )
|
|
set(oneValueArgs DEST NAME)
|
|
set(multiValueArgs SOURCE)
|
|
set(FUNC_LIB_SOURCE smartcont/stdlib.fc)
|
|
cmake_parse_arguments(ARG "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
|
|
string(REGEX REPLACE "[^0-9a-zA-Z_]" "_" ID ${ARG_DEST})
|
|
set(ARG_DEST_FIF "${ARG_DEST}.fif")
|
|
add_custom_command(
|
|
COMMENT "Generate ${ARG_DEST_FIF}"
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
|
COMMAND func -PS -o ${ARG_DEST_FIF} ${FUNC_LIB_SOURCE} ${ARG_SOURCE}
|
|
MAIN_DEPENDENCY ${ARG_SOURCE}
|
|
DEPENDS func ${FUNC_LIB_SOURCE}
|
|
OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/${ARG_DEST_FIF}
|
|
)
|
|
set(ARG_DEST_CPP "${ARG_DEST}.cpp")
|
|
add_custom_command(
|
|
COMMENT "Generate ${ARG_DEST_CPP}"
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
|
COMMAND fift -Ifift/lib:smartcont -s asm-to-cpp.fif ${ARG_DEST_FIF} ${ARG_DEST_CPP} ${ARG_NAME}
|
|
MAIN_DEPENDENCY ${ARG_SOURCE}
|
|
DEPENDS fift ${ARG_DEST_FIF} smartcont/asm-to-cpp.fif fift/lib/Asm.fif
|
|
OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/${ARG_DEST_CPP}
|
|
)
|
|
add_custom_target(gen_fif_${ID} DEPENDS ${ARG_DEST_FIF} ${ARG_DEST_CPP})
|
|
add_dependencies(gen_fif gen_fif_${ID})
|
|
endfunction()
|
|
|
|
GenFif(DEST smartcont/auto/config-code SOURCE smartcont/config-code.fc NAME config)
|
|
GenFif(DEST smartcont/auto/wallet-code SOURCE smartcont/wallet-code.fc NAME wallet)
|
|
GenFif(DEST smartcont/auto/wallet3-code SOURCE smartcont/wallet3-code.fc NAME wallet3)
|
|
GenFif(DEST smartcont/auto/simple-wallet-code SOURCE smartcont/simple-wallet-code.fc NAME simple-wallet)
|
|
GenFif(DEST smartcont/auto/highload-wallet-code SOURCE smartcont/highload-wallet-code.fc NAME highload-wallet)
|
|
GenFif(DEST smartcont/auto/highload-wallet-v2-code SOURCE smartcont/highload-wallet-v2-code.fc NAME highload-wallet-v2)
|
|
GenFif(DEST smartcont/auto/elector-code SOURCE smartcont/elector-code.fc NAME elector-code)
|
|
GenFif(DEST smartcont/auto/multisig-code SOURCE smartcont/multisig-code.fc NAME multisig)
|
|
GenFif(DEST smartcont/auto/restricted-wallet-code SOURCE smartcont/restricted-wallet-code.fc NAME restricted-wallet)
|
|
GenFif(DEST smartcont/auto/restricted-wallet2-code SOURCE smartcont/restricted-wallet2-code.fc NAME restricted-wallet2)
|
|
GenFif(DEST smartcont/auto/restricted-wallet3-code SOURCE smartcont/restricted-wallet3-code.fc NAME restricted-wallet3)
|
|
GenFif(DEST smartcont/auto/pow-testgiver-code SOURCE smartcont/pow-testgiver-code.fc NAME pow-testgiver)
|
|
|
|
GenFif(DEST smartcont/auto/dns-manual-code SOURCE smartcont/dns-manual-code.fc NAME dns-manual)
|
|
GenFif(DEST smartcont/auto/dns-auto-code SOURCE smartcont/dns-auto-code.fc NAME dns-auto)
|
|
|
|
GenFif(DEST smartcont/auto/payment-channel-code SOURCE smartcont/payment-channel-code.fc NAME payment-channel)
|
|
|
|
GenFif(DEST smartcont/auto/simple-wallet-ext-code SOURCE smartcont/simple-wallet-ext-code.fc NAME simple-wallet-ext)
|
|
endif()
|
|
|
|
add_library(smc-envelope ${SMC_ENVELOPE_SOURCE})
|
|
target_include_directories(smc-envelope PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
|
|
target_link_libraries(smc-envelope PUBLIC ton_crypto PRIVATE tdutils ton_block)
|
|
if (NOT CMAKE_CROSSCOMPILING)
|
|
add_dependencies(smc-envelope gen_fif)
|
|
endif()
|
|
|
|
add_executable(create-state block/create-state.cpp)
|
|
target_include_directories(create-state PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>)
|
|
if (INTERNAL_COMPILE)
|
|
target_link_libraries(create-state PUBLIC ton_crypto fift-lib ton_block tonlib git)
|
|
else()
|
|
if (TONLIB_COMPILE)
|
|
target_link_libraries(create-state PUBLIC ton_crypto fift-lib ton_block tonlib git)
|
|
else()
|
|
target_link_libraries(create-state PUBLIC ton_crypto fift-lib ton_block git)
|
|
endif()
|
|
endif()
|
|
if (WINGETOPT_FOUND)
|
|
target_link_libraries_system(create-state wingetopt)
|
|
endif()
|
|
|
|
add_executable(dump-block block/dump-block.cpp)
|
|
target_include_directories(dump-block PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>)
|
|
target_link_libraries(dump-block PUBLIC ton_crypto fift-lib ton_block git)
|
|
if (WINGETOPT_FOUND)
|
|
target_link_libraries_system(dump-block wingetopt)
|
|
endif()
|
|
|
|
add_executable(adjust-block block/adjust-block.cpp)
|
|
target_include_directories(adjust-block PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>)
|
|
target_link_libraries(adjust-block PUBLIC ton_crypto fift-lib ton_block git)
|
|
if (WINGETOPT_FOUND)
|
|
target_link_libraries_system(dump-block wingetopt)
|
|
target_link_libraries_system(adjust-block wingetopt)
|
|
endif()
|
|
|
|
add_executable(test-weight-distr block/test-weight-distr.cpp)
|
|
target_include_directories(test-weight-distr PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>)
|
|
target_link_libraries(test-weight-distr PUBLIC ton_crypto fift-lib ton_block git)
|
|
if (WINGETOPT_FOUND)
|
|
target_link_libraries_system(test-weight-distr wingetopt)
|
|
endif()
|
|
|
|
install(TARGETS fift func create-state tlbc RUNTIME DESTINATION bin)
|
|
install(DIRECTORY fift/lib/ DESTINATION lib/fift)
|
|
install(DIRECTORY smartcont DESTINATION share/ton)
|