Skip to content

Commit

Permalink
support openbsd // make code buildable
Browse files Browse the repository at this point in the history
  • Loading branch information
crypto-ape committed Aug 13, 2019
1 parent 2d537c9 commit 8819b80
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 4 deletions.
16 changes: 13 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -197,13 +197,23 @@ else( WIN32 ) # Apple AND Linux
message( STATUS "Configuring BitShares on OS X" )
set( CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -stdlib=libc++ -Wall" )
else( APPLE )
# Linux Specific Options Here
message( STATUS "Configuring BitShares on Linux" )
if ( "${CMAKE_SYSTEM_NAME}" STREQUAL "OpenBSD" )
# OpenBSD Specific Options
message( STATUS "Configuring BitShares on OpenBSD" )
if ( "${BOOST_ROOT}" STREQUAL "" )
# linking with system boost on OBSD is dynamic
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DBOOST_TEST_DYN_LINK" )
endif()
else()
# Linux Specific Options Here
message( STATUS "Configuring BitShares on Linux" )
set( rt_library rt )
endif()
# Common Linux & OpenBSD Options
set( CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -Wall" )
if(USE_PROFILER)
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pg" )
endif( USE_PROFILER )
set( rt_library rt )
set( pthread_library pthread)
if ( NOT DEFINED crypto_library )
# I'm not sure why this is here, I guess someone has openssl and can't detect it with find_package()?
Expand Down
2 changes: 2 additions & 0 deletions libraries/net/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1342,6 +1342,8 @@ namespace graphene { namespace net { namespace detail {
user_data["fc_git_revision_unix_timestamp"] = fc::git_revision_unix_timestamp;
#if defined( __APPLE__ )
user_data["platform"] = "osx";
#elif defined( __OpenBSD__ )
user_data["platform"] = "obsd";
#elif defined( __linux__ )
user_data["platform"] = "linux";
#elif defined( _MSC_VER )
Expand Down
3 changes: 2 additions & 1 deletion tests/cli/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,10 @@
#include <winsock2.h>
#include <WS2tcpip.h>
#else
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/ip.h>
#include <sys/types.h>
#endif
#include <thread>

Expand Down
5 changes: 5 additions & 0 deletions tests/performance/performance_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

#if defined(BOOST_TEST_DYN_LINK)
#define BOOST_TEST_MAIN
#endif

#include <boost/test/unit_test.hpp>

#include <graphene/chain/database.hpp>
Expand Down

0 comments on commit 8819b80

Please sign in to comment.