peerplays_migrated/libraries/db/CMakeLists.txt

28 lines
682 B
CMake
Raw Normal View History

2015-06-08 15:50:35 +00:00
file(GLOB HEADERS "include/graphene/db/*.hpp")
set( GRAPHENE_DB_FILES
undo_database.cpp
index.cpp
object_database.cpp
Safety Check: Part 2 -- Implement and Integrate Checks Implement a safety check mechanism on object_database, based on the safety_check_policy abstract interface. Create two standard implementations of the safety_check_policy interface, one (null_safety_check) which allows all modifications unconditionally, and the other (database_lock_safety_check) which allows modifications only when unlocked. Integrate these safety checks into chain::database and plugins, so that the consensus databases are locked at all times except during core consensus code pathways. Also ensures that databases are re-locked when calling code outside of consensus pathways from consensus pathways. To make this work, it was necessary to move two objects from the consensus object spaces to a new API object space. The operation_history_object and account_transaction_history_object were moved to the API object space, as they are not actually used by consensus and are maintained by a plugin (which can no longer modify the consensus object spaces, due to the safety checks). Finally, add a mechanism to application and chain::database, which allows the chain to start in "unit testing mode" and allows unchecked actions upon the database within delimited scopes. This was necessary because many tests edit the database directly to set up the environment for their respective tests. This mode is activated by database_fixture so tests can utilize it conveniently, but it is architecturally difficult to enable this mode in production, i.e. from a plugin.
2022-03-12 20:04:08 +00:00
safety_check_policy.cpp
${HEADERS}
)
if (NOT ${GRAPHENE_BUILD_DYNAMIC_LIBRARIES})
add_library( graphene_db ${GRAPHENE_DB_FILES} )
else()
add_library( graphene_db SHARED ${GRAPHENE_DB_FILES} )
endif()
target_link_libraries( graphene_db graphene_protocol fc )
2015-06-08 15:50:35 +00:00
target_include_directories( graphene_db PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include" )
install( TARGETS
graphene_db
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
)
2016-03-17 22:08:27 +00:00
install( FILES ${HEADERS} DESTINATION "include/graphene/db" )