1
0
Fork 0
mirror of https://github.com/ton-blockchain/ton synced 2025-03-09 15:40:10 +00:00

Add option to build static tonlibjson and emulator (#1527)

* add option to build static tonlibjson and emulator

* do not export cmake project in case of static tonlibjson
This commit is contained in:
Marat 2025-02-23 13:01:33 +01:00 committed by GitHub
parent 3ff951c225
commit 1b70e48327
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 8 deletions

View file

@ -1,8 +1,6 @@
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
if (NOT OPENSSL_FOUND)
find_package(OpenSSL REQUIRED)
endif()
option(EMULATOR_STATIC "Build emulator as static library" OFF)
set(EMULATOR_STATIC_SOURCE
transaction-emulator.cpp
@ -22,7 +20,7 @@ include(GenerateExportHeader)
add_library(emulator_static STATIC ${EMULATOR_STATIC_SOURCE})
target_link_libraries(emulator_static PUBLIC ton_crypto smc-envelope)
if (USE_EMSCRIPTEN)
if (EMULATOR_STATIC OR USE_EMSCRIPTEN)
add_library(emulator STATIC ${EMULATOR_SOURCE})
else()
add_library(emulator SHARED ${EMULATOR_SOURCE})
@ -35,7 +33,7 @@ else()
endif()
generate_export_header(emulator EXPORT_FILE_NAME ${CMAKE_CURRENT_BINARY_DIR}/emulator_export.h)
if (USE_EMSCRIPTEN)
if (EMULATOR_STATIC OR USE_EMSCRIPTEN)
target_compile_definitions(emulator PUBLIC EMULATOR_STATIC_DEFINE)
endif()
target_include_directories(emulator PUBLIC