Skip to content

Commit

Permalink
Merge pull request #2 from nathanhourt/master
Browse files Browse the repository at this point in the history
Fix build on Linux
  • Loading branch information
bytemaster authored Apr 5, 2017
2 parents 9094669 + 422ff9e commit 34d8f63
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ ENDIF(WIN32)

FIND_PACKAGE(Boost 1.57 REQUIRED COMPONENTS ${BOOST_COMPONENTS})

SET(PLATFORM_LIBRARIES)

if( APPLE )
# Apple Specific Options Here
message( STATUS "Configuring ChainBase on OS X" )
Expand All @@ -38,6 +40,7 @@ else( APPLE )
if ( FULL_STATIC_BUILD )
set( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libstdc++ -static-libgcc")
endif ( FULL_STATIC_BUILD )
LIST( APPEND PLATFORM_LIBRARIES pthread )
endif( APPLE )

if( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" )
Expand All @@ -63,7 +66,7 @@ endif()

file(GLOB HEADERS "include/*.hpp")
add_library( chainbase src/chainbase.cpp ${HEADERS} )
target_link_libraries( chainbase ${Boost_LIBRARIES} )
target_link_libraries( chainbase ${Boost_LIBRARIES} ${PLATFORM_LIBRARIES} )
target_include_directories( chainbase PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include" ${Boost_INCLUDE_DIR} )

add_subdirectory( test )
Expand Down
2 changes: 1 addition & 1 deletion include/chainbase/chainbase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ namespace chainbase {
{
typedef oid<Derived> id_type;
static const uint16_t type_id = TypeNumber;

};

/** this class is ment to be specified to enable lookup of index type by object type using
Expand Down Expand Up @@ -654,6 +653,7 @@ namespace chainbase {
};

void open( const bfs::path& dir, uint32_t write = read_only, uint64_t shared_file_size = 0 );
bool is_open()const;
void close();
void flush();
void wipe( const bfs::path& dir );
Expand Down
5 changes: 5 additions & 0 deletions src/chainbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,11 @@ namespace chainbase {
}
}

bool database::is_open() const
{
return _segment && _meta && !_data_dir.empty();
}

void database::flush() {
if( _segment )
_segment->flush();
Expand Down

0 comments on commit 34d8f63

Please sign in to comment.