1
0
Fork 0
mirror of https://github.com/ton-blockchain/ton synced 2025-02-13 03:32:22 +00:00
ton/tolk/CMakeLists.txt
tolk-vm 82648ebd6a
[Tolk] Initial commit of TOLK Language: fork all sources from FunC
The Tolk Language will be positioned as "next-generation FunC".
It's literally a fork of a FunC compiler,
introducing familiar syntax similar to TypeScript,
but leaving all low-level optimizations untouched.

Note, that FunC sources are partially stored
in the parser/ folder (shared with TL/B).
In Tolk, nothing is shared.
Everything from parser/ is copied into tolk/ folder.
2024-11-02 01:33:08 +04:00

51 lines
1.7 KiB
CMake

cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
set(TOLK_SOURCE
srcread.cpp
lexer.cpp
symtable.cpp
keywords.cpp
unify-types.cpp
parse-tolk.cpp
abscode.cpp
gen-abscode.cpp
analyzer.cpp
asmops.cpp
builtins.cpp
stack-transform.cpp
optimize.cpp
codegen.cpp
tolk.cpp
)
add_executable(tolk tolk-main.cpp ${TOLK_SOURCE})
target_include_directories(tolk PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
target_link_libraries(tolk PUBLIC git ton_crypto) # todo replace with ton_crypto_core in the future
if (WINGETOPT_FOUND)
target_link_libraries_system(tolk wingetopt)
endif ()
if (USE_EMSCRIPTEN)
add_executable(tolkfiftlib tolk-wasm.cpp ${TOLK_SOURCE})
target_include_directories(tolkfiftlib PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
target_link_libraries(tolkfiftlib PUBLIC fift-lib git)
target_link_options(tolkfiftlib PRIVATE
-sEXPORTED_RUNTIME_METHODS=FS,ccall,cwrap,UTF8ToString,stringToUTF8,lengthBytesUTF8,addFunction,removeFunction,setValue
-sEXPORTED_FUNCTIONS=_tolk_compile,_version,_malloc,_free,_setThrew
-sEXPORT_NAME=CompilerModule
-sERROR_ON_UNDEFINED_SYMBOLS=0
-sFILESYSTEM=1 -lnodefs.js
-Oz
-sIGNORE_MISSING_MAIN=1
-sAUTO_NATIVE_LIBRARIES=0
-sMODULARIZE=1
-sTOTAL_MEMORY=33554432
-sALLOW_MEMORY_GROWTH=1
-sALLOW_TABLE_GROWTH=1
--embed-file ${CMAKE_CURRENT_SOURCE_DIR}/../crypto/fift/lib@/fiftlib
-fexceptions
)
target_compile_options(tolkfiftlib PRIVATE -fexceptions -fno-stack-protector)
endif ()
install(TARGETS tolk RUNTIME DESTINATION bin)