1
0
Fork 0
mirror of https://github.com/ton-blockchain/ton synced 2025-02-12 11:12:16 +00:00

Use BUILD_SHARED_LIBS to decide whether to build libemulator.so (#671)

* Update ubuntu:20.04 dockerfile (#636)

* Update Dockerfile

* Update Dockerfile

---------

Co-authored-by: neodiX42 <neodiX@ton.org>

* Use BUILD_SHARED_LIBS to decide whether to build libemulator.so

---------

Co-authored-by: EmelyanenkoK <emelyanenko.kirill@gmail.com>
Co-authored-by: neodiX42 <neodiX@ton.org>
This commit is contained in:
aleksej.paschenko 2023-04-27 09:33:32 +03:00 committed by GitHub
parent 1d9e5d3672
commit aab1fe0751
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,5 +1,7 @@
cmake_minimum_required(VERSION 3.0.2 FATAL_ERROR)
option(BUILD_SHARED_LIBS "Use \"OFF\" for a static build." ON)
if (NOT OPENSSL_FOUND)
find_package(OpenSSL REQUIRED)
endif()
@ -27,7 +29,12 @@ include(GenerateExportHeader)
add_library(emulator_static STATIC ${EMULATOR_STATIC_SOURCE})
target_link_libraries(emulator_static PUBLIC ton_crypto ton_block smc-envelope)
add_library(emulator STATIC ${EMULATOR_SOURCE} ${EMULATOR_HEADERS})
if (NOT USE_EMSCRIPTEN AND BUILD_SHARED_LIBS)
add_library(emulator SHARED ${EMULATOR_SOURCE} ${EMULATOR_HEADERS})
else()
add_library(emulator STATIC ${EMULATOR_SOURCE} ${EMULATOR_HEADERS})
endif()
target_link_libraries(emulator PUBLIC emulator_static)
generate_export_header(emulator EXPORT_FILE_NAME ${CMAKE_CURRENT_BINARY_DIR}/emulator_export.h)
target_include_directories(emulator PUBLIC