Skip to content

Commit

Permalink
Use BUILD_SHARED_LIBS to decide whether to build libemulator.so (#671)
Browse files Browse the repository at this point in the history
* Update ubuntu:20.04 dockerfile (#636)

* Update Dockerfile

* Update Dockerfile

---------

Co-authored-by: neodiX42 <[email protected]>

* Use BUILD_SHARED_LIBS to decide whether to build libemulator.so

---------

Co-authored-by: EmelyanenkoK <[email protected]>
Co-authored-by: neodiX42 <[email protected]>
  • Loading branch information
3 people authored Apr 27, 2023
1 parent 1d9e5d3 commit aab1fe0
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion emulator/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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()
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit aab1fe0

Please sign in to comment.